小编Bij*_*hal的帖子

如何为代理包含代理身份验证用户名和密码?

我不想为我的办公室网络提供代理设置的用户名/密码,我可以将PROXY提供给浏览器:

String PROXY = "localhost:8080";

org.openqa.selenium.Proxy proxy = new org.openqa.selenium.Proxy();
proxy.setHttpProxy(PROXY)
     .setFtpProxy(PROXY)
     .setSslProxy(PROXY);
DesiredCapabilities cap = new DesiredCapabailities();
cap.setPreference(CapabilityType.PROXY, proxy);
Run Code Online (Sandbox Code Playgroud)

要么

user_pref("network.proxy.http", "127.0.0.1");
user_pref("network.proxy.http_port", 8084);
user_pref("network.proxy.ssl", "127.0.0.1");
user_pref("network.proxy.ssl_port", 8084);
user_pref("network.proxy.no_proxies_on", "localhost:4444");
user_pref("network.proxy.type", 1);
Run Code Online (Sandbox Code Playgroud)

但是,无论我做什么,它仍然要求Webdriver的密码.注意:我可以发送htmlunit驱动程序的用户名/密码.请帮忙!

selenium-webdriver

6
推荐指数
1
解决办法
1883
查看次数

标签 统计

selenium-webdriver ×1