Home > Blockchain >  How to stop selenium to download chromedriver everytime
How to stop selenium to download chromedriver everytime

Time:08-25

I'm always using the following code to initiate my selenium web driver. But the problem is, it always tries to download the latest chrome driver. How can I prevent this behavior and just let it update if there is any update on the real chrome browser?

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

CodePudding user response:

you can download chromedriver for your os and right version from https://chromedriver.chromium.org/downloads and pass the absolute path to executable path below.

driver = webdriver.Chrome(executable_path =r"C:/path/to/chromedriver.exe", options=options)

This will not download the driver again

CodePudding user response:

You could use chromedriver-autoinstaller

import chromedriver_autoinstaller
chromedriver_autoinstaller.install()

After this code then add your code after

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