Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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
like image 443
alnesef2002 Avatar asked Aug 21 '20 16:08

alnesef2002


People also ask

Does ChromeDriver need to match Chrome version?

Specifically: ChromeDriver uses the same version number scheme as Chrome. See https://www.chromium.org/developers/version-numbers for more details. Each version of ChromeDriver supports Chrome with matching major, minor, and build version numbers.

How do I fix ChromeDriver executable in path?

To solve the Selenium error "WebDriverException: Message: 'chromedriver' executable needs to be in PATH", install and import the webdriver-manager module by running pip install webdriver-manager . The module simplifies management of binary drivers for different browsers.

How do I update ChromeDriver in Python?

chromedriver_autoinstaller. install() # Check if the current version of chromedriver exists. # and if it doesn't exist, download it automatically, # then add chromedriver to path.


2 Answers

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 i.e. Chrome Browser session.


Your main issue is the incompatibility between the version of the binaries you are using as follows:

  • You mentioned about using chromedriver=85.0.4183.38 and the release notes of chromedriver=85.0.4183.38 clearly mentions the following :

Supports Chrome version 85

  • Presumably you are using current version of Chrome Browser i.e. Version 84.0.4147.135.

So there is a clear mismatch between ChromeDriver v85.0 and the Chrome Browser v84.0


Solution

Ensure that:

  • 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() within tearDown(){} method to close & destroy the WebDriver and Web Client instances gracefully.

Reference

You can find a relevant detailed discussion in:

  • SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 81
  • selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 80
  • Ubuntu: selenium.common.exceptions: session not created: This version of ChromeDriver only supports Chrome version 79
  • SessionNotCreatedException: session not created: This version of ChromeDriver only supports Chrome version 77 using Selenium ChromeDriver
like image 195
undetected Selenium Avatar answered Sep 28 '22 22:09

undetected Selenium


Make sure chrome driver installed match chrome version installed on your machine and path of chrome driver is set to your PATH Variable. http://chromedriver.chromium.org/downloads

like image 20
Astha Kohli Avatar answered Sep 28 '22 23:09

Astha Kohli