0

I'm tryin to create a bot in Python with Selenium which often has to change the proxy adress in order to do the requests. I've searched now for very long in the internet but I can't figure out how to set my code up so that I can change the proxy host, port, username and password without closing the webdriver and creating a new one.

I've already tried installing a custom Chrome Extension which set up a proxy connection from a background script with chrome.proxy.settings.set and entered the credentials via the chrome.webRequest.onAuthRequired.addListener method. This worked out for me but I wasn't able to change the proxy to whatever I wanted from my Python script.

Does anyone know how to set up a dynamic proxy with credentials for Selenium in Python? I don't care which Browser but the regedit variables for global proxy settings shouldn't be changed.

Tobias Weger
  • 105
  • 8
  • Does [this](https://stackoverflow.com/questions/59409418/how-to-rotate-selenium-webrowser-ip-address/59410739#59410739) discussion helps you? – undetected Selenium May 25 '20 at 15:11
  • @DebanjanB It's an interesting post but no. I'd like the program not have to restart the bot on every change of the proxy. – Tobias Weger May 25 '20 at 20:21
  • Does this answer your question? [How to dynamically change proxies in chrome driver](https://stackoverflow.com/questions/54911913/how-to-dynamically-change-proxies-in-chrome-driver) – kaliiiiiiiii Jun 28 '23 at 16:08

0 Answers0