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.
required
和autocomplete
是两个独立的属性,因此您需要将它们与“and”组合在一起:
//input[@required and @autocomplete="cc-number"]
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.