Chrome自动更新后,chromedriver版本不匹配的问题

Chrome自动更新后,chromedriver版本不匹配的问题

问题

使用selenium模块的webdriver打开网页时,发现报错:
selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 122
Current browser version is 128.0.6613.138 with binary path C:\Program Files\Google\Chrome\Application\chrome.exe

原因是chrome自动更新了版本,chromedriver的版本和chrome不匹配了

解决方法

1.查看当前Chrome浏览器版本并下载对应版本的chromedriver
在这里插入图片描述
下载地址: https://googlechromelabs.github.io/chrome-for-testing/

2.调用 where chromedriver 命令找到之前的chromedriver所在目录
在这里插入图片描述

3.把新下载的chromedriver.exe替换python目录下Scripts文件中的旧chromedriver.exe
在这里插入图片描述
4.再次运行之前程序即可

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值