selenium.common.exceptions.SessionNotCreatedException:消息:未创建会话:此版本的ChromeDriver仅支持Chrome版本85 [英] selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 85

查看:53
本文介绍了selenium.common.exceptions.SessionNotCreatedException:消息:未创建会话:此版本的ChromeDriver仅支持Chrome版本85的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿,所以我有这个简单的代码,可以使用硒打开Goog​​le

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')

我没有打开Goog​​le页面,而是出现了此错误.

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版

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆