简体   繁体   English

使用python硒驱动程序找不到元素错误

[英]Element not found error using python selenium driver

I am getting the element not found error to type input in the search element 我在搜索元素中输入元素找不到错误

Code used by me : 我使用的代码:

 browser.find_element_by_css_selector("input[id='pubicationQuery'][name='publicationQuery']").click()

browser is my webDriver selenium object. 浏览器是我的webDriver硒对象。 I have tried class name, also X path but unable to locate the element. 我尝试了类名,也尝试了X路径,但是无法找到元素。

Error: 错误:

selenium.common.exceptions.NoSuchElementException: Message: Unable to locate element: input[id='pubicationQuery'][name='publicationQuery']

From what I can understand from the error and the image you added, it just a typo 从错误和添加的图像中我可以理解,这只是一个错字

in the code below id should be publicationQuery and not pubicationQuery. 在ID下面的代码中,应为publicationQuery而不是pubicationQuery。

EDIT - forgot to fix the typo 编辑 -忘记修正错字

browser.find_element_by_css_selector("input[id='publicationQuery'][name='publicationQuery']").click()

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

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