javascript - Python Selenium : Unable to click button

标签 javascript python selenium

我是 python 新手,想要编写一个网络抓取工具,其中涉及鼠标单击弹出窗口上的“确定”按钮。

其他一切都很顺利,但我无法单击导致数据下载的最终按钮。

JavaScript 如下:

enter image description here

我尝试通过 id 查找元素,但出现以下错误消息:

enter image description here

最佳答案

find_elements_by_id 返回元素列表。迭代 find_elements_by_id 返回的列表或使用 find_element_by_id (注意缺少的 's'),这将仅返回单个元素(如果有)。

关于javascript - Python Selenium : Unable to click button,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39343408/

相关文章:

python - 'WSGIRequest' 对象没有属性 'cookies'

python - 使用 pow 函数 python 计算 mod

selenium - 多个值的 xpath OR 运算符

javascript - 你如何通过 Javascript 检测用户是否有键盘?

javascript - Screeps 获得所有具有特定内存(角色)的 creeps

javascript - 试图在 javascript 中提醒第二个 child 的 innerhtml

python - Pandas 无效类型比较错误

javascript - 创建类似 jquery 函数链的动态原型(prototype)

python - 脚本突然停止爬取,无错误无异常

java - 如何设置 selenium webdriver 获取超时?