selenium.common.exceptions.SessionNotCreatedException:消息:未创建会话:此版本的ChromeDriver仅支持Chrome版本85 [英] selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 85
本文介绍了selenium.common.exceptions.SessionNotCreatedException:消息:未创建会话:此版本的ChromeDriver仅支持Chrome版本85的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嘿,所以我有这个简单的代码,可以使用硒打开Google
Hey so I have this simple code to open google using selenium
from selenium import webdriver
import chromedriver_binary
driver = webdriver.Chrome()
driver.get('https://google.com')
我没有打开Google页面,而是出现了此错误.
Instead of opening the google page I get this error.
Traceback (most recent call last):
File "main.py", line 5, in <module>
driver = webdriver.Chrome()
File "C:\Users\vipku\AppData\Local\Programs\Python\Python38-32\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 76, in __init__
RemoteWebDriver.__init__(
File "C:\Users\vipku\AppData\Local\Programs\Python\Python38-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 157, in __init__
self.start_session(capabilities, browser_profile)
File "C:\Users\vipku\AppData\Local\Programs\Python\Python38-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 252, in start_session
response = self.execute(Command.NEW_SESSION, parameters)
File "C:\Users\vipku\AppData\Local\Programs\Python\Python38-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "C:\Users\vipku\AppData\Local\Programs\Python\Python38-32\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 85
推荐答案
此错误消息...
selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 85
...表示 ChromeDriver v85.0 无法启动/产生新的浏览上下文,即 Chrome浏览器会话.
...implies that the ChromeDriver v85.0 was unable to initiate/spawn a new Browsing Context i.e. Chrome Browser session.
您的主要问题是所使用的二进制文件版本之间的不兼容性:
Your main issue is the incompatibility between the version of the binaries you are using as follows:
- 您提到过使用 chromedriver = 85.0.4183.38 的情况, chromedriver = 85.0.4183.38 的发行说明中明确提到了以下内容:
- You mentioned about using chromedriver=85.0.4183.38 and the release notes of chromedriver=85.0.4183.38 clearly mentions the following :
支持 Chrome 85版
- 大概您正在使用 Chrome浏览器的当前版本,即版本84.0.4147.135 .
- Presumably you are using current version of Chrome Browser i.e. Version 84.0.4147.135.
- ChromeDriver 已更新为当前的ChromeDriver v84.0 级别.
- Chrome 已更新为当前(发布)的 Chrome版本84.0 级别.(根据 ChromeDriver v84.0发行说明). 通过 IDE
- 清理您的项目工作区和重建您的项目,并且仅具有必需的依赖项.
- 如果您的基本 Web客户端版本太旧,则将其卸载并安装最新版本的 Web客户端 GA.
- 进行系统重启.
- 以非root用户用户的身份执行
@Test
. - 始终在
tearDown(){}
方法中调用driver.quit()
以关闭&优雅地销毁 WebDriver 和 Web Client 实例. - ChromeDriver is updated to current ChromeDriver v84.0 level.
- Chrome is updated to current (released) Chrome Version 84.0 level. (as per ChromeDriver v84.0 release notes).
- Clean your Project Workspace through your IDE and Rebuild your project with required dependencies only.
- If your base Web Client version is too old, then uninstall it and install a recent GA and released version of Web Client.
- Take a System Reboot.
- Execute your
@Test
as non-root user. - Always invoke
driver.quit()
withintearDown(){}
method to close & destroy the WebDriver and Web Client instances gracefully. - SessionNotCreatedException:消息:未创建会话:此版本的ChromeDriver仅支持Chrome版本81
- selenium.common.exceptions.SessionNotCreatedException:消息:未创建会话:此版本的ChromeDriver仅支持Chrome版本80
- Ubuntu:硒.common.exceptions:未创建会话:此版本的ChromeDriver仅支持Chrome版本79
- SessionNotCreatedException:未创建会话:此版本的ChromeDriver仅支持使用Selenium ChromeDriver的Chrome版本77
因此 ChromeDriver v85.0 与 Chrome浏览器v84.0
确保:
您可以在以下位置找到相关的详细讨论:
You can find a relevant detailed discussion in:
这篇关于selenium.common.exceptions.SessionNotCreatedException:消息:未创建会话:此版本的ChromeDriver仅支持Chrome版本85的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文