undetected-chromedriver
undetected-chromedriver copied to clipboard
chrome always updated automatically, how to stop update at win10 system
heres my problem. this mod can download the newest driver, but i need run several mission in one task. each time when i use uc.chrome(), the newest driver is Downloaded . then somehow bug comes. Even if there are no bugs, it will slow the spider. but if i manual setting the driver path, when Chrome updated automatically, selenium won
t work.
someone help ,PLZ i use every method i knew to stop update chrome, but no use.
besides, can this mod check if the current version of chromedriver exists and if it doesn't exist, download it automatically?
The only solution for that is to hardcode the directory to google chrome and chromedriver.
Here is how you can do that (just don't forget to change the paths to match the actual paths in your machine):
from undetected_chromedriver.options import ChromeOptions
from undetected_chromedriver import Chrome
chrome_options = ChromeOptions()
driver = Chrome(
options = chrome_options,
version_main=119, # I also like to set google chrome version
browser_executable_path="/opt/google/chrome/google-chrome",
driver_executable_path="/usr/bin/chromedriver",
)