Closed Damji7 closed 1 month ago
Duplicate of https://github.com/seleniumbase/SeleniumBase/issues/1774#issuecomment-1444399269, https://github.com/seleniumbase/SeleniumBase/issues/2032#issuecomment-1693931853, https://github.com/seleniumbase/SeleniumBase/issues/2151#issuecomment-1741234068, etc.
Due to unresolved issues with selenium-wire
: https://github.com/wkeeling/selenium-wire/search?q=undetected&type=issues, UC Mode and Wire Mode cannot be combined. Pick one or the other.
If you want to change your proxy with Wire Mode (without using UC Mode), here's an example:
from seleniumbase import Driver
driver = Driver(wire=True)
try:
driver.set_wire_proxy("user:pass@ip:port")
driver.open("https://httpbin.io/ip")
driver.sleep(6)
finally:
driver.quit()
For the SB()
format, there's sb.driver.set_wire_proxy("user:pass@ip:port")
If you need UC Mode, then set the proxy
arg to use a proxy:
i want to use the uc mode and when the script finds certain text in the webpage it execute the proxy perform some action and then it rotats to the original ip, is it possible if so can you help ?
You have to decide which proxy to use when you spin up your web browser. After the browser has been spun up, you have to launch a new browser if you want different proxy settings.
so it is impossible to execute the proxy in the same browser session, and there is no possible way to make the proxy dynamically changes when i use the uc mode, right ?
You can't change your proxy in the middle of a browser session when using UC Mode.
Well, Its a BIG PROBLEM HERE, btw Thanks&Regards
hello, How to switch to proxy using selenium wire to performe some actions and then it rotats back to the same ip, by the way my script is using the uc mode in simple sb form.
i want to execute proxy in the same browser session to perform some actions when certain text is visible in the webpage, and the it rotats back to the original ip. is it prossible if so can you help with it.
here is my code snippet:
with SB(uc=True, incognito=True, locale_code='en', wire=True) as sb: def open_the_webpage(sb): url = "web page" sb.uc_open_with_reconnect(url, 2)
def switch_proxy(sb):
how to use seleniumwire here
thanks and regards <3