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.