follow yoyo
定位鼠标悬停才显示的元素,要引入新模块
# coding:utf-8from selenium import webdriverfrom selenium.webdriver.common.action_chains import ActionChains driver = 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()
原文地址:https://www.cnblogs.com/shanliguniang/p/10647862.html
时间: 2024-10-12 07:39:49