selenium执行控制chrome的脚本报错解决办法- Message: session not created: This version of ChromeDriver only supports Chrome version 92 Current browser version is 103.0.5060.66 with binary path
1.selenium执行控制chrome的脚本报错报错内容:
selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 92
Current browser version is 103.0.5060.66 with binary path C:\Users\测试\AppData\Local\Google\Chrome\Application\chrome.exey
报错原因:
chrome的驱动 ChromeDriver 已经过期,不适用当前chrome版本
解决办法:
安装匹配版本的chromedriver
chrome的dirver 驱动下载链接:
https://registry.npmmirror.com/binary.html?path=chromedriver/
步骤:
1.进入驱动下载地址:https://registry.npmmirror.com/binary.html?path=chromedriver/
2.下载对对应版本的chrome驱动
3.将安装包解压,并复制解压后的驱动文件
4.将解压后的驱动文件放在python安装包路径下。
5.再次执行selenium脚本,就不会报错了,执行成功,控制chrome操作