使用给定的答案here我创建了一个类似的表达式来检查元素:
elem = WebDriverWait(browser, 10).until((EC.visibility_of_element_located(By.XPATH, "//input[@placeholder='Search in your collabs']")))
但是,我收到以下错误:
...
elem = WebDriverWait(browser, 10).until((EC.visibility_of_element_located(By.XPATH, "//input[@placeholder='Search in your collabs']")))
TypeError: __init__() takes exactly 2 arguments (3 given)
但根据示例和documentation应该是正确的表达式!那为什么它仍然失败(python2.7
)?
答案 0 :(得分:-1)
语法问题。请参阅 Florent B的第一条评论。