18

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 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:

Any suggestion how to solve the issue till webdriver for Chrome 115 will be finally released here https://chromedriver.chromium.org/downloads

TaKo
  • 321
  • 1
  • 1
  • 7
  • Which version of selenium are you using? Refer this - https://stackoverflow.com/a/76463081/7598774 – Shawn Jul 20 '23 at 08:29

13 Answers13

26

Selenium Manager is now fully included with selenium 4.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 https://chromedriver.chromium.org/downloads only goes up to version 114 due to driver restructuring by the Chromium Team for the new Chrome-for-Testing.

Michael Mintz
  • 9,007
  • 6
  • 31
  • 48
  • 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)` – horace_vr Jul 29 '23 at 06:50
  • 2
    ``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. – Michael Mintz Aug 01 '23 at 12:34
  • 1
    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: https://www.selenium.dev/blog/2022/introducing-selenium-manager/ – Andreito95 Aug 17 '23 at 07:01
10

This worked for me:

 service = Service(ChromeDriverManager(version="114.0.5735.90").install())
ouroboros1
  • 9,113
  • 3
  • 7
  • 26
BRUNO ALVES
  • 101
  • 2
7

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

Shawn
  • 4,064
  • 2
  • 11
  • 23
  • 1
    I use ChromeDriverManager().install() in order to ensure the use of last stable version of webdriver. It works in versions up to 114. – TaKo Jul 20 '23 at 09:04
  • Check my updated answer. Let me know if you have queries. – Shawn Jul 20 '23 at 09:41
  • So, no need to use ChromeDriverManager().install() ? How do I use SeleniumManager in praxis? – TaKo Jul 20 '23 at 10:00
  • 2
    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. – Shawn Jul 20 '23 at 10:05
  • Really appreciate it, solution worked like a charm – D C Aug 27 '23 at 04:21
6

Try this one: service = Service(ChromeDriverManager(version="114.0.5735.90").install())

Vitalii
  • 61
  • 1
  • This was the only solution that works for me. But having to set the version manually isn't ideal. Is there a better solution? – paul Jul 25 '23 at 00:08
  • Paul please see: https://stackoverflow.com/a/76830878/3633653 – iDevFS Aug 03 '23 at 18:58
5

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

pip install --upgrade webdriver-manager
Tyler2P
  • 2,324
  • 26
  • 22
  • 31
  • WOW! That's a beautiful gem and resolved my issue for the 116 release! Thank you so much my guy! – Bryan_C Aug 21 '23 at 20:34
2

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

  • uninstal current installed webdriver and Chrome from the system;
  • find the stable version of webdriver and Chrome here https://googlechromelabs.github.io/chrome-for-testing/
  • search for binary chrome and chromedriver (version of the webdriver and Chrome should be the same!);
  • install Chrome (actually you just unzip it and put it to some folder, ie: c:\chrome-test-ver);
  • set folder c:\chrome-test-ver to the PATH envirounment variable);
  • install webdriver.exe (just unzip it and copy to the Python folder, ie: C:\Users\Administrator\AppData\Local\Programs\Python\Python311);
  • run your python script with selenium and it should work.
TaKo
  • 321
  • 1
  • 1
  • 7
2

Solution for those, who are facing problems after 26-07-2023 in the testing application using selenium 4.8.0, actually on 26-07-2023 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 web driver available.

Good News is that I found the solution and my codes are working perfectly my testing tools are also working fine like the old ones. here are the codes for you. Before going to run these codes following steps need to be done:

Step - 01. pip uninstall selenium Step - 02. pip install selenium==4.10.0 Step - 03. pip show selenium (Make sure the selenium version 4.10.0) is installed. Step - 04. pip install webdriver_manager

##Codes 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)

if anyone wants to stop the automatic update of Chrome, please feel free to ask me, I can also give you the solution for the same.

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)
iDevFS
  • 483
  • 1
  • 10
  • 16
1

From Chrome v115 you will need to install "Google Chrome for Testing" https://developer.chrome.com/blog/chrome-for-testing to run any automated tests locally on Chrome.

Tom Hobbs
  • 11
  • 2
1

The bug is linked to webdriver-manager version.

Please update webdriver-manager to lastest version using:

pip install --upgrade webdriver-manager

It got fixed in version 3.8.6 (13th April 2023)

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.
Andreito95
  • 54
  • 3
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

Shine J
  • 798
  • 1
  • 6
  • 11
0

Solution :

In the command prompt or on pycharm terminal: type

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

  • 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](/help/how-to-answer). – Community Aug 07 '23 at 06:25
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)
Abhishek
  • 1
  • 1