Webdriver and proxy server for firefox

后端 未结 13 2331
清歌不尽
清歌不尽 2020-11-30 23:49

are there any ways to set firefox\'s proxy settings? I found here information about FoxyProxy but when Selenium works, plugins are unactivated in window.

13条回答
  •  -上瘾入骨i
    2020-12-01 00:20

    Look at the documentation page.

    Tweaking an existing Firefox profile

    You need to change "network.proxy.http" & "network.proxy.http_port" profile settings.

    FirefoxProfile profile = new FirefoxProfile();
    profile.addAdditionalPreference("network.proxy.http", "localhost");
    profile.addAdditionalPreference("network.proxy.http_port", "3128");
    WebDriver driver = new FirefoxDriver(profile);
    

提交回复
热议问题