Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/59.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Proxy 使用代理设置时,selenuim 2停止工作_Proxy_Selenium Webdriver - Fatal编程技术网

Proxy 使用代理设置时,selenuim 2停止工作

Proxy 使用代理设置时,selenuim 2停止工作,proxy,selenium-webdriver,Proxy,Selenium Webdriver,我编写了selenuim代码,打开谷歌,将一些搜索条件发送到搜索引擎,然后单击结果页面中的特定链接。一切都很好,但如果我在大多数情况下将代理设置设置为firefox,webDriver会非常缓慢地打开google,一切都会停止。WebDriver找不到google的搜索输入,代码停止 以下是设置代理设置的代码 FirefoxProfile profile = new FirefoxProfile(); profile.setPreference("ne

我编写了selenuim代码,打开谷歌,将一些搜索条件发送到搜索引擎,然后单击结果页面中的特定链接。一切都很好,但如果我在大多数情况下将代理设置设置为firefox,webDriver会非常缓慢地打开google,一切都会停止。WebDriver找不到google的搜索输入,代码停止

以下是设置代理设置的代码

           FirefoxProfile profile = new FirefoxProfile();
           profile.setPreference("network.proxy.type", 1);
           profile.setPreference("network.proxy.http","some Proxy");
           profile.setPreference("network.proxy.http_port", port); 
           driver = new FirefoxDriver(profile);

我不明白为什么我使用代理webDriver时不能正常工作。

谷歌切换到https。为了让它工作,您需要接受SSL证书。Java应该类似,但在Python中只需添加:

profile.accept_untrusted_certs = True
profile.update_preferences()

谷歌转而使用https。为了让它工作,您需要接受SSL证书。Java应该类似,但在Python中只需添加:

profile.accept_untrusted_certs = True
profile.update_preferences()