Webdriver and proxy server for firefox

后端 未结 13 2287
清歌不尽
清歌不尽 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条回答
  • 2020-12-01 00:22
    FirefoxProfile profile = new FirefoxProfile();
    String PROXY = "xx.xx.xx.xx:xx";
    OpenQA.Selenium.Proxy proxy = new OpenQA.Selenium.Proxy();
    proxy.HttpProxy=PROXY;
    proxy.FtpProxy=PROXY;
    proxy.SslProxy=PROXY;
    profile.SetProxyPreferences(proxy);
    FirefoxDriver driver = new FirefoxDriver(profile);
    

    It is for C#

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