英文:
Use a proxy with username and password in Selenium
问题
我正在尝试使用不同的连接和代理测试我的网络应用程序,但是我只有经过身份验证的HTTP代理。
我无法弄清楚在打开连接之前如何对代理进行身份验证。
Proxy proxy = new Proxy();
proxy.setHttpProxy("127.0.0.1:3128");
ChromeOptions options = new ChromeOptions();
options.setCapability("proxy", proxy);
driver = new ChromeDriver(options);
driver.get("https://www.myip.com/");
英文:
I'm trying to test my web app with different connections and proxies, but i only have authenticated HTTP proxies.
I cannot figure out how to authenticate my proxy before opening the connection.
Proxy proxy = new Proxy();
proxy.setHttpProxy("127.0.0.1:3128");
ChromeOptions options = new ChromeOptions();
options.setCapability("proxy", proxy);
driver = new ChromeDriver(options);
driver.get("https://www.myip.com/");
答案1
得分: 0
对于正在寻找答案的人,我使用多重通行证,通过Selenium填充Chrome扩展程序所需的字段。
英文:
For the ones that are searching for an answer, i use multipass, chrome extensions filling via selenium the field necessary
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论