-1

I'm trying to execute selenium to do some web scrapping. I'm trying to use the chrome & chromedriver 117, which are available for download here.

But when I try to execute the script, I get the following error:

ERROR - Message: unknown error: cannot connect to chrome at 127.0.0.1:38421

2023-08-03T15:14:09.917-03:00   from session not created: This version of ChromeDriver only supports Chrome version 114

2023-08-03T15:14:09.917-03:00   Current browser version is 117.0.5926.0

Why chromedriver only supports Chrome 114 if both are of version 117? And it's not exclusive for version 117, even if I use both of version 116 I get the same error.

Daniel Wagner
  • 49
  • 2
  • 5
  • 1
    That error message is telling you that the version of ChromeDriver being executed is *not* the version you think it is. Can you [edit] your question to include how you are initializing the driver? Also, try opening a command prompt and run `where chromedriver` for Windows operating systems, or `which chromedriver` for linux/Max OS. That should tell you where the driver exists in your PATH. – Greg Burghardt Aug 03 '23 at 18:40
  • Does this answer your question? [selenium.common.exceptions.SessionNotCreatedException: This version of ChromeDriver only supports Chrome version 114. LATEST\_RELEASE\_115 doesn't exist](https://stackoverflow.com/questions/76913935/selenium-common-exceptions-sessionnotcreatedexception-this-version-of-chromedri) – Gugu72 Aug 23 '23 at 12:30

1 Answers1

1

This error message...

ERROR - Message: unknown error: cannot connect to chrome at 127.0.0.1:38421
2023-08-03T15:14:09.917-03:00   from session not created: This version of ChromeDriver only supports Chrome version 114
2023-08-03T15:14:09.917-03:00   Current browser version is 117.0.5926.0

...implies that ChromeDriver was unable to connect to the binary due to incompatibility issues.


Details

Though you are using ChromeDriver v114.0 but your Google Chrome version is 117.0. Hence the incompatibility and the error.


Solution with Selenium v4.6+ versions

In case you are using Selenium v4.6 or above, in such cases Selenium Manager can become handy. Selenium Manager is now fully integrated with Selenium and can silently download the matching ChromeDriver and you don't have to explicitly mention the chromedriver path anymore. So your minimal code block can be:

from selenium import webdriver

url = "https://google.com/"
driver = webdriver.Chrome()
driver.get(url)
undetected Selenium
  • 183,867
  • 41
  • 278
  • 352