【发布时间】:2020-01-10 22:32:19
【问题描述】:
您好,我正在尝试使用 selenium 查找要单击的按钮。下面是我正在使用的 HTML 代码的 sn-p。
<input type="button" id="runButton" class="button" value="Run Report" onclick="chooseRun()">
我正在尝试使用下面的代码单击 runButton。
elem = driver.find_element_by_id('runButton').click()
我收到以下错误消息:
NoSuchElementException: Message: Unable to find element with css selector == [id="runButton"]
不知道还有什么可以尝试的。
【问题讨论】:
-
请附上检查元素页面的屏幕截图以及您到目前为止尝试过的代码。 SO 用于帮助开发人员找到解决问题的方法。主要是调试。不提供代码真的很难帮你:)
-
我发布了检查元素的 HTML 以及我尝试过的代码。我继续并附上了检查元素的图片。
标签: python-3.x selenium xpath css-selectors webdriverwait