我收到以下错误:
Traceback (most recent call last): File "[redacted]", line 69, in wait.until(EC.element_to_be_clickable(By.ID("RptViewer_ctl09_ctl04_ctl00_ButtonLink"))) TypeError: 'str' object is not callable
以下是我认为导致问题的代码部分:
66 browser.find_element_by_id('RptViewer_ctl09_ctl04_ctl00_ButtonLink')
67 drp = browser.find_element_by_id('RptViewer_ctl09_ctl04_ctl00_ButtonLink')
68 wait = WebDriverWait(browser, 10)
69 wait.until(EC.element_to_be_clickable(By.ID('RptViewer_ctl09_ctl04_ctl00_ButtonLink')))
70 drp.click()
我认为导致问题的原因是“ID('RptViewer\u ctl09\u ctl04\u ctl00\u ButtonLink')”部分,但我不确定这是不是真的,也不确定如何修复它。非常感谢您的指导。你知道吗
谢谢!你知道吗
在使用WebDriverWait与expected_conditions连接时,必须将定位器包含在元组中,如下所示:
你知道吗按ID是字符串。不能打电话。期望条件采用元组形式的定位器(正如quamrana已经建议的那样)
相关问题 更多 >
编程相关推荐