Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uc have not auto download driver #1459

Open
henzycuong1 opened this issue Aug 10, 2023 · 7 comments · May be fixed by #1509
Open

uc have not auto download driver #1459

henzycuong1 opened this issue Aug 10, 2023 · 7 comments · May be fixed by #1509

Comments

@henzycuong1
Copy link

henzycuong1 commented Aug 10, 2023

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

@VQHieu1012
Copy link

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?

@henzycuong1
Copy link
Author

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

@implicitlycorrect
Copy link

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

@asdas22dd21d
Copy link

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

@hudcap hudcap linked a pull request Aug 25, 2023 that will close this issue
@theskid31
Copy link

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?

@implicitlycorrect
Copy link

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

@petrmoravek6
Copy link

petrmoravek6 commented Nov 27, 2023

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants