Search code examples
pythongoogle-chromeselenium-webdriver

Selenium WebDriver Chrome 115 stopped working


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?


Solution

  • 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.