使用带有用户名和密码的代理在Selenium中。

huangapple go评论74阅读模式
英文:

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

huangapple
  • 本文由 发表于 2020年10月13日 23:00:58
  • 转载请务必保留本文链接:https://go.coder-hub.com/64337788.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定