【发布时间】:2015-02-14 05:30:00
【问题描述】:
在过去的两天里,我一直在尝试将代理与 Selenium 一起使用,但这并不是 确切的问题。问题是代理是 private 这意味着它需要身份验证才能使用它(用户名和密码),但我不知道该怎么做。
我正在使用 Firefox 驱动程序,配置文件如下:
FirefoxProfile firefoxProfile = new FirefoxProfile();
firefoxProfile.SetPreference("network.proxy.type", 1);
firefoxProfile.SetPreference("network.proxy.http", "23.95.115.87");
firefoxProfile.SetPreference("network.proxy.http_port", 80);
var driver = new FirefoxDriver(firefoxProfile);
driver.Navigate().GoToUrl("http://ipchicken.com");
我想它会询问我用户名和密码(在一个对话框中)但什么也没发生,它只是导航到网页,并显示我自己的 IP。我在这方面找不到任何东西,有帮助吗?非常感谢。
【问题讨论】: