简体   繁体   English

SessionNotCreatedException:消息:会话未创建:此版本的 ChromeDriver 仅支持使用 ChromeDriver 和 Chrome 的 Chrome 版本 87

[英]SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 87 using ChromeDriver and Chrome

I am trying to get selenium to open a site and I don't really have any errors in my PyCharm editor but when I run my code I am getting a lot of errors I do not really understand it would be nice to get some help我正在尝试让 selenium 打开一个站点,但我的 PyCharm 编辑器中并没有任何错误,但是当我运行我的代码时,我遇到了很多错误,我不太明白,如果能得到一些帮助会很好

from selenium import webdriver
from selenium.webdriver.common.keys import Keys

driver = webdriver.Chrome(executable_path=r"C:\chromedriver\chromedriver.exe")

driver.get("https://www.singaporetech.edu.sg/")  # get gets url
print(driver.title)  # title of the page

driver.close()

This is the error I get:这是我得到的错误:

C:\Users\kaush\PycharmProjects\seleniumTest1\venv\Scripts\python.exe C:/Users/kaush/PycharmProjects/seleniumTest1/main.py
Traceback (most recent call last):
  File "C:\Users\kaush\PycharmProjects\seleniumTest1\main.py", line 4, in <module>
    driver = webdriver.Chrome(executable_path=r"C:\chromedriver\chromedriver.exe")
  File "C:\Users\kaush\PycharmProjects\seleniumTest1\venv\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 76, in __init__
    RemoteWebDriver.__init__(
  File "C:\Users\kaush\PycharmProjects\seleniumTest1\venv\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 157, in __init__
    self.start_session(capabilities, browser_profile)
  File "C:\Users\kaush\PycharmProjects\seleniumTest1\venv\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 252, in start_session
    response = self.execute(Command.NEW_SESSION, parameters)
  File "C:\Users\kaush\PycharmProjects\seleniumTest1\venv\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
    self.error_handler.check_response(response)
  File "C:\Users\kaush\PycharmProjects\seleniumTest1\venv\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 87
Current browser version is 86.0.4240.198 with binary path C:\Program Files (x86)\Google\Chrome\Application\chrome.exe

This error message...这个错误信息...

selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 87
    Current browser version is 86.0.4240.198 with binary path C:\Program Files (x86)\Google\Chrome\Application\chrome.exe

...implies that the ChromeDriver was unable to initiate/spawn a new Browsing Context ie Chrome Browser session. ...暗示ChromeDriver无法启动/生成新的浏览上下文,Chrome 浏览器会话。

Your main issue is the incompatibility between the version of the binaries you are using as follows:您的主要问题是您使用的二进制文件版本之间的不兼容,如下所示:

  • You are using chromedriver=87.0您正在使用chromedriver=87.0
  • Release Notes of chromedriver=87.0 clearly mentions the following : chromedriver=87.0 的发行说明清楚地提到了以下内容:

Supports Chrome version 87支持Chrome 87 版

  • You are using Chrome v86.0.4240.198您使用的是Chrome v86.0.4240.198

So there is a clear mismatch between ChromeDriver v2.40 and the Chrome Browser v85.0所以ChromeDriver v2.40Chrome 浏览器 v85.0之间存在明显的不匹配


Solution解决方案

Ensure that:确保这件事:

  • ChromeDriver is updated to current ChromeDriver v87.0 level. ChromeDriver更新到当前ChromeDriver v87.0级别。
  • Chrome is updated to current Chrome Version 87.0 level. Chrome已更新到当前的Chrome 版本 87.0级别。 (as per ChromeDriver v87.0 release notes ). (根据ChromeDriver v87.0 发行说明)。
  • If your base Web Client version is too old, then uninstall it and install a recent GA and released version of Web Client .如果您的基本Web 客户端版本太旧,请卸载它并安装最新的 GA 和发布版本的Web 客户端
  • Take a System Reboot .进行系统重启
  • Execute your @Test as non-root user.非 root用户身份执行@Test
  • Always invoke driver.quit() within tearDown(){} method to close & destroy the WebDriver and Web Client instances gracefully.始终在tearDown(){}方法中调用driver.quit()以优雅地关闭和销毁WebDriverWeb Client实例。

I am trying to get selenium to open a site and I don't really have any errors in my PyCharm editor but when I run my code I am getting a lot of errors I do not really understand it would be nice to get some help我试图用硒打开一个网站,而我的PyCharm编辑器中确实没有任何错误,但是当我运行代码时,我遇到了很多错误,我不太了解获得帮助会很不错。

from selenium import webdriver
from selenium.webdriver.common.keys import Keys

driver = webdriver.Chrome(executable_path=r"C:\chromedriver\chromedriver.exe")

driver.get("https://www.singaporetech.edu.sg/")  # get gets url
print(driver.title)  # title of the page

driver.close()

This is the error I get:这是我得到的错误:

C:\Users\kaush\PycharmProjects\seleniumTest1\venv\Scripts\python.exe C:/Users/kaush/PycharmProjects/seleniumTest1/main.py
Traceback (most recent call last):
  File "C:\Users\kaush\PycharmProjects\seleniumTest1\main.py", line 4, in <module>
    driver = webdriver.Chrome(executable_path=r"C:\chromedriver\chromedriver.exe")
  File "C:\Users\kaush\PycharmProjects\seleniumTest1\venv\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 76, in __init__
    RemoteWebDriver.__init__(
  File "C:\Users\kaush\PycharmProjects\seleniumTest1\venv\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 157, in __init__
    self.start_session(capabilities, browser_profile)
  File "C:\Users\kaush\PycharmProjects\seleniumTest1\venv\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 252, in start_session
    response = self.execute(Command.NEW_SESSION, parameters)
  File "C:\Users\kaush\PycharmProjects\seleniumTest1\venv\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
    self.error_handler.check_response(response)
  File "C:\Users\kaush\PycharmProjects\seleniumTest1\venv\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 87
Current browser version is 86.0.4240.198 with binary path C:\Program Files (x86)\Google\Chrome\Application\chrome.exe

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 SessionNotCreatedException:消息:会话未创建:此版本的 ChromeDriver 仅支持带有 Selenium ChromeDriver 的 Chrome 版本 76 - SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 76 with Selenium ChromeDriver SessionNotCreatedException:消息:session 未创建:此版本的 ChromeDriver 仅支持使用 Selenium ChromeDriver v81 的 Chrome 版本 81 - SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 81 using Selenium ChromeDriver v81 SessionNotCreatedException:消息:session 未创建:此版本的 ChromeDriver 仅支持 Chrome 版本 99 当前浏览器版本为 105 - SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 99 Current browser version is 105 selenium.common.exceptions.SessionNotCreatedException:消息:session 未创建:此版本的 ChromeDriver 仅支持 Chrome 版本 85 - selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 85 selenium.common.exceptions.SessionNotCreatedException:消息:session 未创建:此版本的 ChromeDriver 仅支持 Chrome 版本 83 - selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 83 SessionNotCreatedException:消息:session 未创建:此版本的 ChromeDriver 仅支持 Chrome 版本 81 I - SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 81 I SessionNotCreatedException:消息:未创建会话:尽管安装了 Chrome v74,但此版本的 ChromeDriver 仅支持 Chrome 版本 74 - SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 74 though Chrome v74 is installed 消息:session 未创建:此版本的 ChromeDriver 仅支持 Chrome 版本 85 - Message: session not created: This version of ChromeDriver only supports Chrome version 85 SessionNotCreatedException:此版本的 ChromeDriver 仅支持 Chrome 版本 84 使用 ChromeDriver 和 Chrome 通过 Selenium 和 Python - SessionNotCreatedException: This version of ChromeDriver only supports Chrome version 84 using ChromeDriver and Chrome through Selenium and Python Python selenium - session not created: This version of ChromeDriver only supports Chrome version 86 using ChromeDriver and Chrome with Selenium - Python selenium - session not created: This version of ChromeDriver only supports Chrome version 86 using ChromeDriver and Chrome with Selenium
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM