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