Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/332.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
selenium自动化期间出错selenium.common.exceptions.NoSuchElementException:消息:无法定位元素:python_Python_Selenium Webdriver - Fatal编程技术网

selenium自动化期间出错selenium.common.exceptions.NoSuchElementException:消息:无法定位元素:python

selenium自动化期间出错selenium.common.exceptions.NoSuchElementException:消息:无法定位元素:python,python,selenium-webdriver,Python,Selenium Webdriver,我正在尝试使用网站上标签的XPath,并使用chrome/firefox收集XPath,但每次我都会遇到如下异常: 我一直保持睡眠时间,可以看到网站加载相当早的睡眠时间仍然得到错误 said\u input=driver.通过xpath('/*[@id=“ctl00\u ctl00\u contentplaceholder 1\u contentplaceholder 3Col\u txtSubmitCase”]”查找元素 打印(所述输入) 表示输入。发送按键(表示) 例外情况: seleniu

我正在尝试使用网站上标签的XPath,并使用chrome/firefox收集XPath,但每次我都会遇到如下异常:

我一直保持睡眠时间,可以看到网站加载相当早的睡眠时间仍然得到错误

said\u input=driver.通过xpath('/*[@id=“ctl00\u ctl00\u contentplaceholder 1\u contentplaceholder 3Col\u txtSubmitCase”]”查找元素
打印(所述输入)
表示输入。发送按键(表示)
例外情况:
selenium.common.exceptions.NoSuchElementException:消息:无法定位元素:[id=“ctl00\u ctl00\u contentplaceholder 1\u contentplaceholder 3Col\u txtSubmitCase”]

一件事是,我已经导航到了网站的另一个页面,通过单击菜单按钮之一,这个驱动程序将被激活。通过xpath查找元素将能够找到它。如果没有,如果我需要浏览多个页面并填写几张表格,我该怎么做。

您能分享一下您想与之互动的内容吗?页面上的哪个网站和哪个特定元素最可能的问题是id是动态生成的,您只需要匹配它的一部分,或者找到此元素的另一个唯一静态标识符<代码>HTML与元素一起使用会很有帮助。没有ID或xpath,我已经验证了时间,并且它是相同的[静态]。