有没有办法设置Firefox的代理设置?我在这里找到了关于FoxyProxy的信息,但当Selenium工作时,窗口中的插件未被激活。
有没有办法设置Firefox的代理设置?我在这里找到了关于FoxyProxy的信息,但当Selenium工作时,窗口中的插件未被激活。
有没有办法设置Firefox的代理设置?我在这里找到了关于FoxyProxy的信息,但当Selenium工作时,窗口中的插件未被激活。
有没有办法设置Firefox的代理设置?我在这里找到了关于FoxyProxy的信息,但当Selenium工作时,窗口中的插件未被激活。
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);
这是针对C#的
还有另一种解决方案,我寻找它是因为我在处理像这样的代码时遇到了问题(它在Firefox中设置系统代理):
FirefoxProfile profile = new FirefoxProfile();
profile.setPreference("network.proxy.http", "localhost");
profile.setPreference("network.proxy.http_port", "8080");
driver = new FirefoxDriver(profile);
FirefoxProfile profile = new FirefoxProfile();
localhostProxy.setProxyType(Proxy.ProxyType.MANUAL);
localhostProxy.setHttpProxy("localhost:8080");
profile.setProxyPreferences(localhostProxy);
driver = new FirefoxDriver(profile);
如果它能帮助的话...
首选项 -> 高级 -> 网络 -> 连接(配置 Firefox 如何连接到互联网)