我想点击悬停后可见的按钮.它的
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'
有什么建议吗?