Changing the proxy server during Selenium

后端 未结 1 1016
长情又很酷
长情又很酷 2021-01-24 10:23

So everything works

fp = webdriver.FirefoxProfile()
fp.set_preference(\"network.proxy.type\", 1)
fp.set_preference(\"network.proxy.http\", PROXY_HOST)
fp.set_pre         


        
相关标签:
1条回答
  • 2021-01-24 10:49

    When using WebDriver with Firefox, the use of the profile is a one-time thing. When the driver launches the browser, it writes the profile object to disk, then starts the browser executable. After that point, there is no mechanism for the browser to read any further changes to the WebDriver profile object. To change the proxy, you have to set the settings in the profile before the browser is launched.

    0 讨论(0)
提交回复
热议问题