undetected-chromedriver icon indicating copy to clipboard operation
undetected-chromedriver copied to clipboard

chrome always updated automatically, how to stop update at win10 system

Open dlliang14 opened this issue 1 year ago • 1 comments

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

dlliang14 avatar Nov 15 '23 08:11 dlliang14

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",
)

pedro-peixot0 avatar Dec 26 '23 14:12 pedro-peixot0