I have used ChromeDriverManager
for over 1 year and no issues with it when Chrome browser has been updated but today I have the following error message:
There is no such driver by URL https://chromedriver.storage.googleapis.com/115.0.5790/chromedriver_win32.zip
I can see that by manually opening the link that the URL doesn't exist.
Any help would be great, Ideally still using ChromeDriverManager
but if not any workaround would be good for now as there are a lot of dependencies on this package for me.
This is my current code:
from selenium import webdriver
from selenium.common.exceptions import WebDriverException
from selenium.webdriver.chrome.options import Options as ChromeOptions
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from webdriver_manager.chrome import ChromeDriverManager
def __init__(self):
# Initialize any necessary attributes here
self.headless_mode = False
def chrome_driver(self):
# Set webdriver options
options = ChromeOptions()
options.headless = self.headless_mode
# Add options arguments to webdriver
options.add_argument("--log-level=3")
options.add_argument("--start-maximized")
options.add_argument('--no-sandbox')
options.add_argument('--disable-dev-shm-usage')
options.add_experimental_option("prefs", {
"download.default_directory": f'r"D:\\Users\\{os.getlogin()}\\Downloads\\"',
"download.prompt_for_download": False,
"download.directory_upgrade": True,
"safebrowsing.enabled": True
})
# Create webdriver with options from above
driver_for_chrome = webdriver.Chrome(ChromeDriverManager().install(), options=options)
# Return the driver to be used in other scripts
return driver_for_chrome'