成功解决BUG:selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 94
Current browser version is 114.0.5735.199 with binary path C:\Program Files\Google\Chrome\Application\chrome.exe
异常解读
在使用 Python 操作 selenium 的时候,会出现如下错误:
selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 94
Current browser version is 114.0.5735.199 with binary path C:\Program Files\Google\Chrome\Application\chrome.exe
该错误翻译为中文是:
chromedriver.exe
版本不对。
实际编码错误如下图所示。
解决思路
这个BUG是由于Chrome驱动程序(chromedriver)版本过低导致的BUG,我们可以去对应网址寻找指定 chromedriver 版本。
下载地址:https://registry.npmmirror.com/binary.html?path=chromedriver/
下载前在查看一下本地 Chrome 版本。
接下来找对与你本地版本对应的驱动即可
其他学习资料
- 《滚雪球学Python》专栏与实体书:https://dream.blog.csdn.net/article/details/131268344
- 《爬虫100例》:https://blog.csdn.net/hihell/category_9280209.html
- 《Python爬虫120》:https://blog.csdn.net/hihell/category_11079529.html