Selenium WebDriver Chrome 115 stopped working
Asked Answered
G

14

29

I have Chrome 115.0.5790.99 installed on Windows, and I use Selenium 4.10.0. In my Python code, I call service = Service(ChromeDriverManager().install()) and it returns the error:

ValueError: There is no such driver by url [sic] https://chromedriver.storage.googleapis.com/LATEST_RELEASE_115.0.5790.

I use ChromeDriverManager().install() in order to ensure the use of last stable version of webdriver. How to solve the issue?

My simple code:

from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from webdriver_manager.chrome import ChromeDriverManager
import time

# Install Webdriver
service = Service(ChromeDriverManager().install())

# Create Driver Instance
driver = webdriver.Chrome(service=service)

# Get Web Page
driver.get('https://www.crawler-test.com')
time.sleep(5)
driver.quit()

Error output:

Traceback (most recent call last):
  File "C:\Users\Administrator\Documents\...\test.py", line 7, in <module>
    service = Service(ChromeDriverManager().install())
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\webdriver_manager\chrome.py", line 39, in install
    driver_path = self._get_driver_path(self.driver)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\webdriver_manager\core\manager.py", line 30, in _get_driver_path
    file = self._download_manager.download_file(driver.get_driver_download_url())
                                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\webdriver_manager\drivers\chrome.py", line 40, in get_driver_download_url
    driver_version_to_download = self.get_driver_version_to_download()
                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\webdriver_manager\core\driver.py", line 51, in get_driver_version_to_download
    self._driver_to_download_version = self._version if self._version not in (None, "latest") else self.get_latest_release_version()
                                                                                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\webdriver_manager\drivers\chrome.py", line 62, in get_latest_release_version
    resp = self._http_client.get(url=latest_release_url)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\webdriver_manager\core\http.py", line 37, in get
    self.validate_response(resp)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\webdriver_manager\core\http.py", line 16, in validate_response
    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/LATEST_RELEASE_115.0.5790

I tried the following but no success:

How can I solve the issue till webdriver for Chrome 115 will be finally released at the download location?

Gymnast answered 20/7, 2023 at 7:55 Comment(1)
Which version of selenium are you using? Refer this - https://mcmap.net/q/67581/-unable-to-use-selenium-webdriver-getting-two-exceptionsCoker
G
2

Until the stable webdriver version 115 is released, the solution is to use the test webdriver and test Chrome accordingly. The steps are:

  • uninstall the current installed webdriver and Chrome from the system;

  • find the stable version of webdriver and Chrome at Chrome for Testing availability

  • search for the binary Chrome and chromedriver (the version of the webdriver and Chrome should be the same!);

  • install Chrome (actually you just unzip it and put it in some folder, i.e.: C:\chrome-test-ver);

  • set folder C:\chrome-test-ver to the PATH environment variable);

  • install webdriver.exe (just unzip it and copy it to the Python folder, i.e.: C:\Users\Administrator\AppData\Local\Programs\Python\Python311);

  • run your Python script with Selenium, and it should work.

Gymnast answered 20/7, 2023 at 10:38 Comment(0)
P
35

Selenium Manager is now fully included with Selenium4.10.0, so this is all you need:

from selenium import webdriver
from selenium.webdriver.chrome.service import Service

service = Service()
options = webdriver.ChromeOptions()
driver = webdriver.Chrome(service=service, options=options)
# ...
driver.quit()

If the driver isn't found on your system PATH, Selenium Manager will automatically download it.


If you're wondering why you're now seeing this error for ChromeDriverManager, it's because Downloads only goes up to version 114 due to driver restructuring by the Chromium Team for the new Chrome-for-Testing.

Prairial answered 20/7, 2023 at 15:40 Comment(3)
This worked for me, with Chrome 115 installed; webdriver downloaded the latest chromedriver version it could find (114): Error getting version of chromedriver 115. Retrying with chromedriver 114 (attempt 1/5) I needed to change my code from: browser = webdriver.Chrome(service=Service(ChromeDriverManager().install()), options=chrome_options) into browser = webdriver.Chrome(service=Service(), options=chrome_options)Metre
selenium just released version 4.11.2 for Python with support for newer chromedrivers. Be sure to upgrade before Chrome 116 comes out to avoid errors.Prairial
This answer should be considered as the solution! After version 4.8 of Selenium, SeleniumManager has been included in Selenium. This implementation makes it no longer necessary to implement third-party libraries, such as "webdriver-manager" or similar. The code snipped posted by @MichaelMintz is the right one to use, and i suggest to update Selenium to last version 4.11.2 as it fixes some Selenium Manager bugs (still in test). Read here for more info: selenium.dev/blog/2022/introducing-selenium-managerMonolithic
V
9

This worked for me:

 service = Service(ChromeDriverManager(version="114.0.5735.90").install())
Validate answered 22/7, 2023 at 1:37 Comment(1)
this does not work anymore. Is there any other workaround without updating selenium?Congreve
C
7

I am not sure which version of Selenium you are using. If you are on latest version say Selenium v4.6.0 or higher, you don't have to use a third-party library such as WebDriverManager to handle browser drivers. Your code can be simplified as below:

from selenium import webdriver

driver = webdriver.Chrome()
driver.get("https://www.crawler-test.com")
print(driver.title)

Result:

Crawler Test Site

Process finished with exit code 0

Update: ChromeWebDriverManager has nothing to do with ensuring stable version of WebDriver, it is used to ensure the correct version of driver binaries (chormedriver.exe) are used as per the browser version in your system. Having said that, now with selenium v4.6.0 or above, selenium's in-built tool SeleniumManager will handle the browser drivers for us. In other words, SeleniumManager will do what WebDriverManager used to do.

Reference: Introducing Selenium Manager

Coker answered 20/7, 2023 at 8:46 Comment(5)
I use ChromeDriverManager().install() in order to ensure the use of last stable version of webdriver. It works in versions up to 114.Gymnast
Check my updated answer. Let me know if you have queries.Coker
So, no need to use ChromeDriverManager().install() ? How do I use SeleniumManager in praxis?Gymnast
Nope, no need. If your selenium version is 4.6.0 or above, then no need to do anything just use the code in my answer. Internally selenium will download and handle browser driver binaries for you.Coker
When I go to Pypi.org for python or nuget.org for C# , latest version is 4.16. Could you please tell how to install selenium 4.6 in python? Cause pip install selenium is for 4.16 version and so many problems in launching it. Alos latest version is 4.16 here: selenium.dev/downloadsCarpentaria
F
6

Try this one:

service = Service(ChromeDriverManager(version="114.0.5735.90").install())
Frequency answered 21/7, 2023 at 6:13 Comment(2)
This was the only solution that works for me. But having to set the version manually isn't ideal. Is there a better solution?Doxy
Paul please see: https://mcmap.net/q/67428/-selenium-webdriver-chrome-115-stopped-workingCottage
B
6

I've updated webdriver-manager and didn't face any issues afterwards.

pip install --upgrade webdriver-manager
Blunge answered 28/7, 2023 at 13:18 Comment(1)
WOW! That's a beautiful gem and resolved my issue for the 116 release! Thank you so much my guy! 👍Flagging
D
3

The solution for those who are facing problems after 26-07-2023 in the testing application using Selenium 4.8.0. Actually on 2023-07-26, Chrome automatically updated to version 115.0.5790.110 and its web driver is not uploaded yet anywhere, the most reliable site https://googlechromelabs.github.io/chrome-for-testing/#stable and https://chromedriver.chromium.org/downloads, but nowhere is the web driver available.

The good news is that I found the solution and my code is working perfectly. My testing tools are also working fine like the old ones. Here is the code for you. Before going to run this code, the following steps need to be done:

Step 1. pip uninstall selenium Step 2. pip install selenium==4.10.0 Step 3. pip show selenium (Make sure the Selenium version 4.10.0) is installed. Step 4. pip install webdriver_manager

Code in Python/Selenium 4.10.0

from time import sleep
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from webdriver_manager.chrome import ChromeDriverManager

options = webdriver.ChromeOptions()
driver = webdriver.Chrome(service=Service(ChromeDriverManager().install()),
options=options)

url = 'https://www.google.com/'
driver.get(url)
driver.maximize_window()
sleep(10)
Diaphoresis answered 30/7, 2023 at 22:53 Comment(0)
G
2

Until the stable webdriver version 115 is released, the solution is to use the test webdriver and test Chrome accordingly. The steps are:

  • uninstall the current installed webdriver and Chrome from the system;

  • find the stable version of webdriver and Chrome at Chrome for Testing availability

  • search for the binary Chrome and chromedriver (the version of the webdriver and Chrome should be the same!);

  • install Chrome (actually you just unzip it and put it in some folder, i.e.: C:\chrome-test-ver);

  • set folder C:\chrome-test-ver to the PATH environment variable);

  • install webdriver.exe (just unzip it and copy it to the Python folder, i.e.: C:\Users\Administrator\AppData\Local\Programs\Python\Python311);

  • run your Python script with Selenium, and it should work.

Gymnast answered 20/7, 2023 at 10:38 Comment(0)
C
2

To avoid the need to manually update to the latest version you can try:

import urllib.request
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.chrome.options import Options
from webdriver_manager.chrome import ChromeDriverManager

try:
    service = Service(ChromeDriverManager().install())
except ValueError:
    latest_chromedriver_version_url = "https://chromedriver.storage.googleapis.com/LATEST_RELEASE"
    latest_chromedriver_version = urllib.request.urlopen(latest_chromedriver_version_url).read().decode('utf-8')
    service = Service(ChromeDriverManager(version=latest_chromedriver_version).install())

options = Options()
options.add_argument('--headless') #optional.
driver = webdriver.Chrome(service=service, options=options)
driver.get(url)
Cottage answered 3/8, 2023 at 18:47 Comment(0)
S
1

From Chrome v115 you will need to install "Google Chrome for Testing" to run any automated tests locally on Chrome.

Senn answered 26/7, 2023 at 14:16 Comment(0)
M
1

The bug is linked to the webdriver-manager version.

Please update webdriver-manager to the latest version using:

pip install --upgrade webdriver-manager

It got fixed in version 3.8.6 (2023-03-13).

Fixed version download logic for Chrome/Edge:

  • if version="latest" - downloads LATEST_RELEASE for Chrome/Chromiums and LATEST_STABLE for Edge;
  • if version=x.x.x - downloads x.x.x;
  • if version is None - tries to determine installed browser version, and if fail - downloads like "latest" - LATEST_RELEASE.
Monolithic answered 2/8, 2023 at 16:36 Comment(0)
G
1

This issue arose because starting from version 115, ChromeDriver release process is integrated with that of Chrome, i.e, it will be available at: the Chrome for Testing (CfT) availability dashboard.

If you want a convenient json: CfT JSON endpoints

You could write your method to download the json from the link mentioned above and download the driver for your version of Chrome.

Reference: ChromeDriver - For versions 115 and newer

Goodtempered answered 8/8, 2023 at 3:16 Comment(0)
D
0

Solution:

In the command prompt or in the PyCharm terminal: type

pip uninstall webdriver_manager
Click on Y (yes)
Then type pip install webdriver_manager.

Decomposed answered 3/8, 2023 at 17:18 Comment(1)
Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.Otisotitis
B
0

I was running Selenium 3.11 and upgrading it to v4.11.2 resolved the issues.

For Windows, run this command to upgrade the version.

pip install selenium --upgrade

I also added these statements to my Selenium script to know which versions the system is operating on -

browser_version = driver.capabilities['browserVersion']
driver_version = driver.capabilities['chrome']['chromedriverVersion'].split(' ')[0]

print ("Selenium version:", selenium.__version__)
print("browser version", browser_version)
print("driver version", driver_version)
Brutish answered 18/8, 2023 at 16:34 Comment(0)
F
0

The best way I solved mine was to use Firefox. You'll just make a little adjustment to your code.

  • download the driver
  • then follow the documentation and then write you logic.
Flapjack answered 27/9, 2023 at 7:56 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.