【问题标题】:when I connect proxy with selenium, It doesn't finish load当我用硒连接代理时,它没有完成加载
【发布时间】:2016-10-02 14:47:29
【问题描述】:

当我用 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);
}

此连接后浏览器无法打开任何页面。 它得到无尽的负载......

如果有人知道这个问题。 请告诉我!

【问题讨论】:

    标签: selenium firefox proxy


    【解决方案1】:

    试试这个代码

    ffprofile.setPreference("network.proxy.type",1);
    ffprofile.setPreference("network.proxy.http", ip);
    ffprofile.setPreference("network.proxy.http_port", port);
    

    【讨论】:

      猜你喜欢
      • 2018-06-02
      • 1970-01-01
      • 1970-01-01
      • 2015-02-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-10-30
      • 1970-01-01
      相关资源
      最近更新 更多