selenium执行报错result.webdriverValue.value的处理过程

1. 示例代码

from selenium import webdriver

driver = webdriver.Chrome()
driver.get('http://124.223.30.31:xxx/forum.php')
driver.find_element('id','ls_username').send_keys('admin')

端口我匿了

这个代码是没有问题的,任意其他代码在当前的环境下都是会出现这个错误的

2. 报错

从下面的报错可以看到在find_element的时候出错了,而这个代码以前是ok的

核心的出错提示selenium.common.exceptions.WebDriverException: Message: unknown error: result.webdriverValue.value list is missing or empty in Runtime.callFunctionOn response

闻所未闻哈~

Traceback (most recent call last):
  File "D:\demo.py", line 11, in <module>
    driver.find_element('id','ls_username').send_keys('admin')
  File "D:\Python39\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 856, in find_element
    return self.execute(Command.FIND_ELEMENT, {
  File "D:\Python39\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 434, in execute
    self.error_handler.check_response(response)
  File "D:\Python39\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 247, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: result.webdriverValue.value list is missing or empty in Runtime.callFunctionOn response
  (Session info: chrome=119.0.6045.124)
Stacktrace:
	...(省去几百字)

3. 搜

匹配的结果不多,倒还有

https://github.com/SeleniumHQ/selenium/issues/13084

原来是驱动版本的问题

4. 环境

当前环境:

chrome version:119.0.6045.124 (正式版本) (64 位) (cohort: Stable) 
chromedriver version:  118.0.5993.70
selenium:4.3.0

更新下驱动https://googlechromelabs.github.io/chrome-for-testing/

https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/119.0.6045.105/win64/chromedriver-win64.zip

下载替换,再次运行搞定

  • 7
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

wuxianfeng023

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值