0

I'm using Chrome 115.0.5790.110, and I use Selenium 4.10.0.

This is my python code:

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

options = Options()
options.add_argument("start-maximized")
driver = webdriver.Chrome(service=Service(ChromeDriverManager().install()), options=options)

This is the error when I run it:

ValueError                                Traceback (most recent call last)
Cell In[11], line 3
      1 options = Options()
      2 options.add_argument("start-maximized")
----> 3 driver = webdriver.Chrome(service=Service(ChromeDriverManager().install()), options=options)

File c:\Users\user1\AppData\Local\Programs\Python\Python311\Lib\site-packages\webdriver_manager\chrome.py:39, in ChromeDriverManager.install(self)
     38 def install(self) -> str:
---> 39     driver_path = self._get_driver_path(self.driver)
     40     os.chmod(driver_path, 0o755)
     41     return driver_path

File c:\Users\user1\AppData\Local\Programs\Python\Python311\Lib\site-packages\webdriver_manager\core\manager.py:30, in DriverManager._get_driver_path(self, driver)
     27 if binary_path:
     28     return binary_path
---> 30 file = self._download_manager.download_file(driver.get_url())
     31 binary_path = self.driver_cache.save_file_to_cache(driver, file)
     32 return binary_path

File c:\Users\user1\AppData\Local\Programs\Python\Python311\Lib\site-packages\webdriver_manager\core\download_manager.py:28, in WDMDownloadManager.download_file(self, url)
     26 def download_file(self, url: str) -> File:
     27     log(f"About to download new driver from {url}")
---> 28     response = self._http_client.get(url)
     29     return File(response)

File c:\Users\user1\AppData\Local\Programs\Python\Python311\Lib\site-packages\webdriver_manager\core\http.py:33, in WDMHttpClient.get(self, url, **kwargs)
     31 def get(self, url, **kwargs) -> Response:
     32     resp = requests.get(url=url, verify=self._ssl_verify, stream=True, **kwargs)
---> 33     self.validate_response(resp)
     34     if wdm_progress_bar():
     35         show_download_progress(resp)

File c:\Users\user1\AppData\Local\Programs\Python\Python311\Lib\site-packages\webdriver_manager\core\http.py:16, in HttpClient.validate_response(resp)
     14 status_code = resp.status_code
     15 if status_code == 404:
---> 16     raise ValueError(f"There is no such driver by url {resp.url}")
     17 elif status_code == 401:
     18     raise ValueError(f"API Rate limit exceeded. You have to add GH_TOKEN!!!")

ValueError: There is no such driver by url https://chromedriver.storage.googleapis.com/115.0.5790/chromedriver_win32.zip

This script is intended to be run routinely so I cannot specify a Chrome version. I have Chrome auto-update enabled and I need it to always download the latest chromedriver.

  • Check this answer - https://stackoverflow.com/a/76799299/7598774 or this https://stackoverflow.com/a/76752843/7598774 – Shawn Jul 31 '23 at 09:58
  • There have been several similar posts recently. It looks like the dynamic download mechanism is broken. Use Firefox – DarkKnight Jul 31 '23 at 09:58
  • It worked with the solution given by Shawn. ``` options = Options() options.add_argument("start-maximized") driver = webdriver.Chrome(options=options) ``` – Juan de la Cuadra Jul 31 '23 at 10:47
  • Does this answer your question? [selenium webdriver chrome 115 stopped working](https://stackoverflow.com/questions/76727774/selenium-webdriver-chrome-115-stopped-working) – Shawn Jul 31 '23 at 10:47

1 Answers1

0

It worked with the solution given by Shawn, using the native webdriver by Selenium.

options = Options()
options.add_argument("start-maximized")
driver = webdriver.Chrome(options=options)