Skip to content

How to use proxy with extension #2397

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

Closed
belalmuhamedd opened this issue Dec 30, 2023 · 1 comment
Closed

How to use proxy with extension #2397

belalmuhamedd opened this issue Dec 30, 2023 · 1 comment
Labels
duplicate The answer/solution already exists somewhere question Someone is looking for answers UC Mode / CDP Mode Undetected Chromedriver Mode / CDP Mode

Comments

@belalmuhamedd
Copy link

i add captchaBot extension to driver but when using proxy (without auth) cant connect to server in extension but in chrome works well .. how i can make it work ?

driver = Driver(undetected=True, headed=True, agent=userAgent, extension_dir='./dir', proxy=f'http://{proxy}')

@mdmintz mdmintz added duplicate The answer/solution already exists somewhere question Someone is looking for answers UC Mode / CDP Mode Undetected Chromedriver Mode / CDP Mode labels Dec 30, 2023
@mdmintz
Copy link
Member

mdmintz commented Dec 30, 2023

Possibly a duplicate of #2247, but it's unclear since you haven't provided any details about your environment, or any stack traces or error messages.

You could also try:

from seleniumbase import SB

with SB(uc=True, xvfb=True, extension_dir="./dir", proxy="server:port") as sb:
    sb.driver.uc_open_with_reconnect(URL, 5)

(After filling in the proxy info, URL, and making sure your extension directory is valid.)

And if that didn't work, swap xvfb=True with headless2=True.

But whatever you do, don't set the user agent yourself in UC Mode. It's automatically set to an agent that won't get you detected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate The answer/solution already exists somewhere question Someone is looking for answers UC Mode / CDP Mode Undetected Chromedriver Mode / CDP Mode
Projects
None yet
Development

No branches or pull requests

2 participants