Voglio fare clic su un pulsante che è visibile dopo il passaggio del mouse. La sua html è:Come fare clic su un elemento visibile dopo il passaggio del mouse sul selenio?
<span class="info"></span>
Ho usato questo codice:
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()
Non funziona però. Ho ottenuto un errore collegata con l'ultima riga di codice element.click():
selenium.common.exceptions.ElementNotVisibleException: Message: \
u'Element is not currently visible and so may not be interacted with'
Qualche suggerimento per favore?
Gli errori sono esattamente? – Arran
@ Arran, ho modificato la domanda. – nutship