报错提示
selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 96
Current browser version is 104.0.5112.81 with binary path C:\Program Files\Google\Chrome\Application\chrome.exe
Stacktrace:
Backtrace:
原因:ChromeDriver与本地chrome浏览器的版本不一致导致
解决方法:
第一步、查找chromedrciver.exe
的位置,替换ChromeDriver与本地chrome浏览器的版本保持一致
命令行窗口输入:
where chromedriver
第二步、查看自己谷歌版本号
第三步、下载对应浏览器版本驱动,替换
需要把它放到下面“两个”路径下即可!
http://chromedriver.storage.googleapis.com/index.html
ChromeDriver下载地址:
第一个路径(python路径Scripts目录下):E:\install\python-3.7.4-amd64\Scripts\chromedriver.exe
第二个路径(chrome安装路径):E:\install\chrome\chromedriver.exe