您应该尝试使用
ExplicitWaits,直到
documents链接可见并启用单击,如下所示:-
from selenium import webdriverfrom selenium.webdriver.common.by import Byfrom selenium.webdriver.support.ui import WebDriverWaitfrom selenium.webdriver.support import expected_conditions as ECfrom selenium.webdriver.common.action_chains import ActionChainswait = WebDriverWait(driver, 10)download_menu = driver.find_element_by_id("DownloadMenu")action = ActionChains(driver)#hover on download_menu firstaction.move_to_element(download_menu).perform()#now find documents link and clickdocuments = wait.until(EC.element_to_be_clickable((By.link_TEXT, "documents")))documents.click()
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)