我想点击悬停后可见的按钮。它的HTML是:
<span class="info"></span>
我使用了这段代码:
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'
有什么建议吗?