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

user-data-dir parameter #1876

Open
bayhax opened this issue May 9, 2024 · 1 comment
Open

user-data-dir parameter #1876

bayhax opened this issue May 9, 2024 · 1 comment

Comments

@bayhax
Copy link

bayhax commented May 9, 2024

import undetected_chromedriver as uc
options = uc.ChromeOptions()

Case 1

options.add_argument("--user-data-dir=/xxx/xxxx/xxx/xxx") options.add_argument('--profile-directory=Profile 10')

Case 2

options.add_argument("user-data-dir=/xxx/xxxx/xxx/xxx") options.add_argument('--profile-directory=Profile 10')

In case 1: It does not use the specified data directory. but case2 works fine, no problem.
The only difference between the two is whether or not --

Why is this happening and how to solve it?

@max32002
Copy link

no_sandbox=True
browser_args = []
conf = Config(browser_args=browser_args, no_sandbox=no_sandbox)
prefs_filepath = os.path.join(conf.user_data_dir,"Default")

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

No branches or pull requests

2 participants