![](/img/trans.png)
[英]For loop not working for XPATH in driver.find_element_by_xpath
[英]not a valid xpath expression driver.find_element_by_xpath
無法弄清楚是什么問題,請幫助。
driver.find_element_by_xpath('//input[@required autocomplete="cc-number"]')
字符串'//input[@required autocomplete="cc-number"]'
不是有效的 XPath 表達式。
required
和autocomplete
是兩個獨立的屬性,因此您需要將它們與“and”組合在一起:
//input[@required and @autocomplete="cc-number"]
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.