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

Undetected chromedriver not allowing setup for auth proxy #2077

Open
Gitkakkar1597 opened this issue Nov 12, 2024 · 1 comment
Open

Undetected chromedriver not allowing setup for auth proxy #2077

Gitkakkar1597 opened this issue Nov 12, 2024 · 1 comment

Comments

@Gitkakkar1597
Copy link

Gitkakkar1597 commented Nov 12, 2024

Hi, I am undetected-chromedriver==3.5.5 , with selenium==4.26.1 (configured for python 3.10 only).
I am trying to scrape a website but can't add/setup my http auth proxy using
uc.ChromeOptions.add_argument(f'--proxy-server = {PROXY}')

I have even tried selenium-wire options but since it isn't maintained, it doesn't works as well.
I am hoping I can work this out without switching to seleniumbase(uc mode) or driverless/nodriver

import undetected_chromedriver as uc
chrome_options = uc.ChromeOptions()
chrome_options.add_argument("--no-sandbox")
chrome_options.add_argument("--disable-dev-shm-usage")
chrome_options.add_argument(f"user-agent={UserAgent().chrome}")
chrome_options.add_argument("--disable-blink-features=AutomationControlled")
chrome_options.add_argument("--incognito")
chrome_options.headless = False
if PROXY:
    chrome_options.add_argument(f'--proxy-server = {PROXY}')

driver = uc.Chrome(
    use_subprocess=False,
    service=ChromeService(executable_path=DRIVER_PATH),
    options=chrome_options
)
@mdmintz
Copy link

mdmintz commented Nov 15, 2024

With SeleniumBase UC Mode, that's just:

from seleniumbase import Driver

driver = Driver(uc=True, proxy="USER:PASS@SERVER:PORT")
driver.uc_open_with_reconnect(URL)

To bypass detection on any site, there's SeleniumBase CDP Mode.

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