简体   繁体   中英

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.

requiredautocomplete是两个独立的属性,因此您需要将它们与“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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM