首页 > 编程 > Python > 正文

处理Selenium3+python3定位鼠标悬停才显示的元素

2019-11-25 12:09:31
字体:
来源:转载
供稿:网友

先给大家介绍下Selenium3+python3--如何定位鼠标悬停才显示的元素

定位鼠标悬停才显示的元素,要引入新模块

# coding:utf-8from selenium import webdriverfrom selenium.webdriver.common.action_chains import ActionChainsdriver = webdriver.Firefox()driver.get("http://www.baidu.com")# 定位百度页面上鼠标悬停设置按钮mouse = driver.find_element_by_link_text("设置")ActionChains(driver).move_to_element(mouse).perform()driver.find_element_by_link_text("高级搜索").click()

知识点扩展:

python selenium 鼠标悬停

#鼠标悬停chain = ActionChains(driver)implement = driver.find_element_by_link_text()chain.move_to_element(implement).perform()

 模拟鼠标悬停后,后搜索需要内容

总结

以上所述是小编给大家介绍的处理Selenium3+python3定位鼠标悬停才显示的元素,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对武林网网站的支持!
如果你觉得本文对你有帮助,欢迎转载,烦请注明出处,谢谢!

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表