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

uc have not auto download driver

Open henzycuong1 opened this issue 1 year ago • 7 comments

Code:

options = ChromeOptions() options.add_argument("--disable-gpu") options.add_argument("--no-first-run") options.add_argument(f"--user-data-dir={user_dir}") driver = uc(options=options,browser_executable_path=user_dir.replace('Data\profile','GoogleChromePortable.exe'), suppress_welcome=False, user_multi_procs=True, version_main=102)

Error:

max() arg is an empty sequence Traceback (most recent call last): File "d:\ToolAirDropPython\task_etc\nansen\nansen_register.py", line 274, in executing driver = uc(options=options,browser_executable_path=user_dir.replace('Data\profile','GoogleChromePortable.exe'), suppress_welcome=False, user_multi_procs=True, version_main=BROWSER_VERSION)
File "C:\Users\Four\AppData\Local\Programs\Python\Python39\lib\site-packages\undetected_chromedriver_init_.py", line 258, in init self.patcher.auto() File "C:\Users\Four\AppData\Local\Programs\Python\Python39\lib\site-packages\undetected_chromedriver\patcher.py", line 118, in auto most_recent = max(files, key=lambda f: f.stat().st_mtime) ValueError: max() arg is an empty sequence

henzycuong1 avatar Aug 10 '23 16:08 henzycuong1

when I'm using uc, I just driver=uc.Chrome(), one question is parameter 'browser_executable_path' is executable path of chromedriver or anything else?

VQHieu1012 avatar Aug 11 '23 04:08 VQHieu1012

when I'm using uc, I just driver=uc.Chrome(), one question is parameter 'browser_executable_path' is executable path of chromedriver or anything else?

I use path of chrome.exe, which open broswer

henzycuong1 avatar Aug 11 '23 05:08 henzycuong1

I get the same error on a raspberry pi, but it works fine on my windows machine.

ghost avatar Aug 14 '23 21:08 ghost

Same. I'm getting this error only with user_multi_procs=True and only in Windows Server machine Works fine on Windows 10

asdas22dd21d avatar Aug 14 '23 22:08 asdas22dd21d

I get the same error on a raspberry pi, but it works fine on my windows machine.

how do you get it to get past the execute error in rpi? are u using rpi4?

theskid31 avatar Sep 25 '23 22:09 theskid31

I get the same error on a raspberry pi, but it works fine on my windows machine.

how do you get it to get past the execute error in rpi? are u using rpi4?

I did use raspberry pi 4 but it shouldnt matter the execute error I assume is because the chromedriver binary doesnt have the correct permissions or is not the correct architechture (arm64 for raspberrypi) its a long time ago now so I dont remember exactly

ghost avatar Oct 10 '23 22:10 ghost

Does anybody know how to fix this problem? When I use the driver locally (Linux) it works, but i get the same error when trying to run it inside Docker container (based on Debian 12)

This is what constructing webdriver looks like in my app: driver = uc.Chrome(driver_executable_path=config.PATH_TO_CHROMEDRIVER, options=chrome_options, seleniumwire_options=wire_options, no_sandbox=True, user_multi_procs=True, use_subprocess=False, version_main=config.UC_CHROMEDRIVER_VER)

UPDATE: I found out that I get the same error even on my local PC when I run the app as root (Docker also runs the app as root)

petrmoravek6 avatar Nov 27 '23 18:11 petrmoravek6