简体   繁体   English

不是有效的 xpath 表达式 driver.find_element_by_xpath

[英]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 表达式。

requiredautocomplete是两个独立的属性,因此您需要将它们与“and”组合在一起:

//input[@required and @autocomplete="cc-number"]

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 对于 driver.find_element_by_xpath 中的 XPATH 循环不起作用 - For loop not working for XPATH in driver.find_element_by_xpath 问题 "driver.find_element_by_xpath("//div[@class='example']" - Problem " driver.find_element_by_xpath("//div[@class='example']" 使用 driver.find_element_by_xpath().clear() 清除输入字段 - Clear input field with driver.find_element_by_xpath().clear() 硒无法使用driver.find_element_by_xpath捕获 - Can't capture by driver.find_element_by_xpath used by selenium 硒 Python 使用 driver.find_element_by_xpath() 显示 DeprecationWarnings - Seleneium Python shows DeprecationWarnings with driver.find_element_by_xpath() selenium 驱动程序,button=driver.find_element_by_xpath(“//input[@id='alpha']”) 消息:没有这样的元素:无法定位元素 - selenium driver, button=driver.find_element_by_xpath(“//input[@id='alpha']”) Message: no such element: Unable to locate element Python Selenium driver.find_element_by_xpath 在 iframe 中找不到元素 - Python Selenium driver.find_element_by_xpath can't find element within iframe 为什么在 Selenium 命令 driver.find_element_by_xpath 不起作用? - Why in Selenium the command driver.find_element_by_xpath doesn't work? 为什么我的 for 循环在我的列表中途失败? Selenium webdriver,driver.find_element_by_xpath - Why is my for loop failing halfway through my list? Selenium webdriver, driver.find_element_by_xpath 如果找不到某个 driver.find_element_by_xpath,如何让我的代码跳过一行 - How do I make my code skip a line if a certain driver.find_element_by_xpath isnt found
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM