Rotating proxies in Selenium

2019-04-10 21:21发布

I use Selenium webdriver for Firefox with Scrapy and now I need to change proxies dynamically but all I've found so far in docs is that I can specify proxy in profile when I instantiate webdriver itself. So it means that I can't change proxy in dynamically?

Is there any way to do that?

1条回答
\"骚年 ilove
2楼-- · 2019-04-10 21:47

selenium does not provide this kind of functionality. It is not possible to dynamically change the browser preferences/desired capabilities once you've launched the browser.

You have to close/quit the browser and start up another webdriver instance with a new proxy configuration.

See also relevant discussion:

查看更多
登录 后发表回答