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

2024-10-02 08:29:27 发布

您现在位置:Python中文网/ 问答频道 /正文

i need to click second row submit button我试图使用网站上的选项卡的XPath,并使用chrome/firefox收集XPath,但似乎每次我都会遇到如下异常:

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

 said_input = driver.find_element_by_xpath('//*[@id="ctl00_ctl00_ContentPlaceHolder1_ContentPlaceHolder3Col_txtSubmitCase"]')
 print(said_input)
 said_input.send_keys(said)

exception:
selenium.common.exceptions.NoSuchElementException: Message: Unable to locate element: [id="ctl00_ctl00_ContentPlaceHolder1_ContentPlaceHolder3Col_txtSubmitCase"]

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


Tags: toidinput网站时间页面elementneed

热门问题