我的任务是编写一个解析器以单击网站上的一个按钮,但我只能单击其中一个按钮而遇到问题。以下代码适用于除一个按钮之外的所有按钮。这是html:http: //pastebin.com/6dLF5ru8这是源html:http: //pastebin.com/XhsedGLbpython代码: driver = webdriver.Firefox() ... el = driver.find_element_by_id("-spel-nba") actions.move_to_element(el) actions.sleep(.1) actions.click() actions.perform()我收到此错误。ElementNotVisibleException: Message: Element is not currently visible and so may not be interacted with根据赛富尔,我刚刚尝试等待相同的元素不可见异常:wait = WebDriverWait(driver, 10)wait.until(EC.presence_of_element_located((By.XPATH, "//input[contains(@id,'spsel')][@value='nba']"))).click()
添加回答
举报
0/150
提交
取消