[英]selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 85
Hey so I have this simple code to open google using selenium嘿,所以我有这个简单的代码来使用 selenium 打开谷歌
from selenium import webdriver
import chromedriver_binary
driver = webdriver.Chrome()
driver.get('https://google.com')
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
This error message...此错误消息...
selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 85
...implies that the ChromeDriver v85.0 was unable to initiate/spawn a new Browsing Context ie Chrome Browser session. ...意味着ChromeDriver v85.0无法启动/产生新的浏览上下文,即Chrome 浏览器session。
Your main issue is the incompatibility between the version of the binaries you are using as follows:您的主要问题是您使用的二进制文件版本之间的不兼容,如下所示:
Supports Chrome version 85支持Chrome 版本 85
So there is a clear mismatch between ChromeDriver v85.0 and the Chrome Browser v84.0因此ChromeDriver v85.0和Chrome 浏览器 v84.0之间存在明显的不匹配
Ensure that:确保这件事:
@Test
as non-root user.以非 root用户身份执行您的@Test
。driver.quit()
within tearDown(){}
method to close & destroy the WebDriver and Web Client instances gracefully.始终在tearDown(){}
方法中调用driver.quit()
以优雅地关闭和销毁WebDriver和Web 客户端实例。You can find a relevant detailed discussion in:您可以在以下位置找到相关的详细讨论:
Make sure chrome driver installed match chrome version installed on your machine and path of chrome driver is set to your PATH Variable.确保安装的 chrome 驱动程序与您机器上安装的 chrome 版本匹配,并且 chrome 驱动程序的路径设置为您的 PATH 变量。 http://chromedriver.chromium.org/downloads http://chromedriver.chromium.org/downloads
I fixed it by using this code pip install chromedriver-binary==83.0.4103.39
我使用此代码修复了它pip install chromedriver-binary==83.0.4103.39
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.