selenium如何定位鼠标悬停才显示的按钮
# coding:utf-8 from selenium import webdriver from selenium.webdriver.common.action_chains import ActionChains driver = webdriver.Firefox() driver.get("http://xxxxxxx.com") # 定位鼠标悬停才显示的“退出登录”按钮 mouse = self.driver.find_element_by_xpath("//*[contains(text(),'hello')]") ActionChains(self.driver).move_to_element(mouse).perform() self.driver.find_element_by_xpath("//*[contains(text(),'退出登录')]").click()
本文来自博客园,作者:{Tester十点半},转载请注明原文链接:https://www.cnblogs.com/jialeliu/p/13994443.html