admin管理员组文章数量:1665202
chrome的版本和Selenium支持的版本不一致,报错如下:
seleniummon.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 86
Current browser version is 92.0.4515.131 with binary path C:\Users\Administrator\AppData\Local\Google\Chrome\Application\chrome.exe
解决方法:
1.查询Chrome的版本
报错里面其实也有说明版本是92.0.4515.131。如果报错没有说明Chrome版本,可以在Chrome浏览器地址栏输入chrome://version/
2.下载对应的Chrome版本driver
http://chromedriver.storage.googleapis/index.html
我是在windows环境下的,选择对应的下载资源。
3.解压后放入Chrome安装路径下
4.配置PATH或者使用的时候加上ChromeDriver的路径
(1)方法一:配置PATH
使用的时候直接用,不用加ChromeDriver的路径。
import selenium
from selenium import webdriver
brower = webdriver.Chrome()
brower.get("https://www.baidu/")
(2)方法二:使用的时候加上ChromeDriver的路径
这种方法不用配置环境变量,要加上ChromeDriver的路径。
import selenium
from selenium import webdriver
path =r"C:\Users\Administrator\XXX\Google\Chrome\Application\chromedriver.exe"
brower = webdriver.Chrome(executable_path=path)
brower.get("https://www.baidu/")
版权声明:本文标题:Chrome的版本和Selenium支持的版本不一致 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://www.elefans.com/xitong/1730043095a1220496.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论