I‘m using Python & selenium writing a crawler program, once Chrome webdriver instance was created, is there a way to change the proxy IP dynamically?
hope for your help, thanks in advance.
Asked
Active
Viewed 1,037 times
-1

Hunter Zhao
- 4,589
- 2
- 25
- 39
-
Worth looking https://stackoverflow.com/questions/20884089/dynamically-changing-proxy-in-firefox-with-selenium-webdriver – Jitendra Banshpal Jan 25 '19 at 17:50
-
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 Apr 06 '23 at 22:35
1 Answers
0
I don't believe you can change proxy without first destroying and creating a new browser instance. In my program where I implemented proxies I had a for loop create a new browser and then passed that browser as an argument to the functions I had created that needed it. Perhaps I am just ignorant of a way to dynamically do it, but as I recall the proxy information needs to be specified when the browser instance is created so again I would not think that what you are trying to do is possible...

Reedinationer
- 5,661
- 1
- 12
- 33
-
It is possible using a remote-controlled extension or seleniumwire now [resource](https://github.com/kaliiiiiiiiii/Selenium-Profiles#set-proxies-dynamically-or-with-options) – kaliiiiiiiii Jun 28 '23 at 16:09