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

How to change the proxy settings of an active browser in the middle of a test? #2100

Closed
gouravkumar99 opened this issue Sep 12, 2023 · 1 comment
Labels
duplicate The answer/solution already exists somewhere question Someone is looking for answers UC Mode Undetected Chromedriver Mode (--uc)

Comments

@gouravkumar99
Copy link

          Thanks @mdmintz for the support, but I am not using wire. I am using the Driver() option as follows:

proxy_d = f"{self.PROXY_USER}:{self.PROXY_PASSWORD}@{self.PROXYURL}:{self.proxy_randomport}" driver = Driver(uc=True,user_data_dir=user_data_dir, multi_proxy=True, proxy=proxy_d)

i want to change new proxy in running browser.

Originally posted by @gouravkumar99 in #1807 (comment)

@mdmintz mdmintz changed the title Thanks @mdmintz for the support, but I am not using wire. I am using the Driver() option as follows: How to change the proxy settings of an active browser in the middle of a test? Sep 12, 2023
@mdmintz mdmintz added duplicate The answer/solution already exists somewhere question Someone is looking for answers UC Mode Undetected Chromedriver Mode (--uc) labels Sep 12, 2023
@mdmintz
Copy link
Member

mdmintz commented Sep 12, 2023

@gouravkumar99 - Duplicate of #1807 (comment)

The only way to change the proxy of an active browser in the middle of a test is with Wire Mode enabled (--wire) and using the set_wire_proxy() method:

self.set_wire_proxy("SERVER:PORT")
self.set_wire_proxy("socks5://SERVER:PORT")
self.set_wire_proxy("USERNAME:PASSWORD@SERVER:PORT")

(Note that Wire Mode cannot be used together with UC Mode.)

@mdmintz mdmintz closed this as completed Sep 12, 2023
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 Undetected Chromedriver Mode (--uc)
Projects
None yet
Development

No branches or pull requests

2 participants