James
James

Reputation: 299

Can't run selenium Chromedriver (was working fine before)

so today I went to run a program I made in python 3, but it kept crashing when it tried to open chromium. I haven't updated python or the chromedriver.exe so it was strange why it didn't work.

Current version of chrome driver I have installed: 74.0.3729.6

I have tried the following things but it didn't work:

  1. Updating to the latest version of the chrome driver (v77.0.3865.10)
  2. Downgrading to v73 of the chrome driver

Nothing has worked. Could someone please assist me.


I made this test program with just it launching the chrome browser:

main.py

from selenium import webdriver

options = webdriver.ChromeOptions()
options.add_argument("--window-size=1920,1080")
driver = webdriver.Chrome(options=options)
driver.create_options()
driver.maximize_window()

crash message:

DevTools listening on ws://127.0.0.1:50904/devtools/browser/c1dc7138-e0cb-4ce4-a
561-56588f5ffd26
Traceback (most recent call last):
  File "main.py", line 5, in <module>
    driver = webdriver.Chrome(options=options)
  File "C:\Users\myUser\AppData\Local\Programs\Python\Python37-32\lib\site-packages
\selenium\webdriver\chrome\webdriver.py", line 81, in __init__
    desired_capabilities=desired_capabilities)
  File "C:\Users\myUser\AppData\Local\Programs\Python\Python37-32\lib\site-packages
\selenium\webdriver\remote\webdriver.py", line 157, in __init__
    self.start_session(capabilities, browser_profile)
  File "C:\Users\myUser\AppData\Local\Programs\Python\Python37-32\lib\site-packages
\selenium\webdriver\remote\webdriver.py", line 252, in start_session
    response = self.execute(Command.NEW_SESSION, parameters)
  File "C:\Users\myUser\AppData\Local\Programs\Python\Python37-32\lib\site-packages
\selenium\webdriver\remote\webdriver.py", line 321, in execute
    self.error_handler.check_response(response)
  File "C:\Users\myUser\AppData\Local\Programs\Python\Python37-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 crea
ted: This version of ChromeDriver only supports Chrome version 74
  (Driver info: chromedriver=74.0.3729.6 (255758eccf3d244491b8a1317aa76e1ce10d57
e9-refs/branch-heads/3729@{#29}),platform=Windows NT 6.3.9600 x86_64)

Upvotes: 0

Views: 1157

Answers (1)

Heladio Amaya
Heladio Amaya

Reputation: 968

The version of both Chrome (or Chromium) and Chromedriver must coincide.

As you can see in the error, your current Chromedriver only works with Chromium version 74.

Check the version of you Chromium and install the corresponding version of Chromedriver. To do this you can run the following command in a terminal.

apt-cache policy chromium

Upvotes: 1

Related Questions