[英]Getting error in using expected_conditions in python + selenium
我一直在使用python和selenium进行自动化,这是我经常遇到的错误。
WebDriverException: Message: u'An invalid or illegal string was specified'
我不确定是怎么了。 此错误在我的代码的以下行中发生:
wait = WebDriverWait(self.driver, 10)
wait.until(expected_conditions.element_to_be_clickable(By.CSS_SELECTOR,"a:contains(Sign In)"))
请帮忙!
问题是a:contains(Sign in)
是无效的CSS。
如果您想使用CSS, a[href*='Sign In']
也许可以解决问题,但是看起来您正在单击链接,因此最好的解决方案是使用By.LINK_TEXT,"Sign In"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.