5

I have an error:

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

I have already used the code to get latest version of webdriver-

from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
options = webdriver.ChromeOptions()
options.add_argument("--allow-running-insecure-content")
options.add_argument("--ignore-certificate-errors")
options.set_capability("acceptInsecureCerts", True)

        preferences = {"profile.default_content_settings.popups": 0,
                       "download.default_directory": r""+Constants.path+"",
                       # IMPORTANT - ENDING SLASH V IMPORTANT
                       "directory_upgrade": True}
options.add_experimental_option("prefs", preferences)

driver = webdriver.Chrome(executable_path=ChromeDriverManager().install(), options=options)

With this same code I am able to run this code on my local machine(i.e. laptop) but this code is not working on my Virtual machine. the chrome version on both machine is same i.e. - 109.0.5414.120.

Please guide.

AnilD
  • 61
  • 1
  • 7
  • one week ago this code was working fine. This error starts coming from Friday(27Jan2023). – AnilD Jan 30 '23 at 07:49

5 Answers5

3

your problem is as below: this ChromeDriverManager().install() will get LATEST chromedriver version -in my case today, it is 115.0.5790- at

https://chromedriver.storage.googleapis.com/

but on their site LATEST chromedriver version has not been ready to be installed

-> LATEST chromedriver version has not been ready to be installed

solution is, as @kaliiiiiiiii said, driver = webdriver.Chrome(executable_path=ChromeDriverManager(version="114.0.5735.16").install(), options=options)

lam vu Nguyen
  • 433
  • 4
  • 9
2

Try using:

driver = webdriver.Chrome(executable_path=ChromeDriverManager(version="109.0.5414.74").install(), options=options)

resource

kaliiiiiiiii
  • 925
  • 1
  • 2
  • 21
  • this code does not work, It gives the below error- `raise ValueError(f"There is no such driver by url {resp.url}") ValueError: There is no such driver by url https://chromedriver.storage.googleapis.com/109.0.5414.120/chromedriver_win32.zip Process finished with exit code 1` – AnilD Jan 30 '23 at 16:41
  • Just updated my answer, does it now work? – kaliiiiiiiii Jan 30 '23 at 16:45
  • you have a shortage of double quote =)) thanks for your solution, it is helpful – lam vu Nguyen Jul 22 '23 at 07:49
2

While the answers here are correct, however, for future readers, there are notable changes.

  1. ChromeDriverManager() is no longer required in Selenium version v4.6.0 and greater.
    See Selenium documentation: As of Selenium 4.6, Selenium downloads the correct driver for you. You shouldn’t need to do anything..
  2. In Selenium manager 4.10.0 (released 07 Jun '23), the executable_path was removed.
    However, one can still pass in an executable_path, using the service arg:
    service=Service(executable_path='path_to_chromedriver')
    This is not recommended.

Readers should refer to answers from this SO.

PS: Selenium manager 4.11.0 is now released: 31 Jul '23.

semmyk-research
  • 333
  • 1
  • 9
1

On my virtual machine, I found that there are two different versions(one latest and one older version) of chrome installed at two different locations. Therefore I uninstalled both chrome and deleted all chrome/google associated folders and files then install a fresh version of the google chrome browser. Finally, the code runs successfully.

AnilD
  • 61
  • 1
  • 7
1

In addition to the answers suggested by others, simply upgrading your selenium webdriver-manager to the latest version may also help - at least in some cases.

pip install webdriver-manager --upgrade
Jim C
  • 1,785
  • 1
  • 13
  • 13