[英]not a valid xpath expression driver.find_element_by_xpath
Can't figure out whats wrong, please help.无法弄清楚是什么问题,请帮助。
driver.find_element_by_xpath('//input[@required autocomplete="cc-number"]')
The string '//input[@required autocomplete="cc-number"]'
is not a valid XPath expression.字符串
'//input[@required autocomplete="cc-number"]'
不是有效的 XPath 表达式。
required
和autocomplete
是两个独立的属性,因此您需要将它们与“and”组合在一起:
//input[@required and @autocomplete="cc-number"]
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.