python selenium鼠标点击_python – 如何在使用selenium悬停后单击可见的元素?

我想点击悬停后可见的按钮.它的

HTML是:

我用过这段代码:

import selenium.webdriver as webdriver

from selenium.webdriver.common.action_chains import ActionChains

url = "http://example.com"

driver = webdriver.Firefox()

driver.get(url)

element = driver.find_element_by_class_name("info")

hov = ActionChains(driver).move_to_element(element)

hov.perform()

element.click()

虽然不行.我得到一个错误连接到最后一行代码element.click():

selenium.common.exceptions.ElementNotVisibleException: Message: \

u'Element is not currently visible and so may not be interacted with'

有什么建议吗?

你可能感兴趣的:(python,selenium鼠标点击)