当我将proxy连接到selenium时,它没有完成加载。
public void startFireFoxWithProxy(String ip) {
//Create a new Firefox profile
FirefoxProfile ffprofile = new FirefoxProfile();
//Then add the proxy setting to the Firefox profile we created
ffprofile.setPreference("network.proxy.http", ip);
ffprofile.setPreference("network.proxy.http_port", "3128");
driver = new FirefoxDriver(ffprofile);
}
连接后浏览器无法打开任何页面。它得到无限的负载…
如果有人知道这个问题。请让我知道!
试试这个代码
ffprofile.setPreference("network.proxy.type",1);
ffprofile.setPreference("network.proxy.http", ip);
ffprofile.setPreference("network.proxy.http_port", port);