How to use authenticated proxy in selenium chromedriver?

前端 未结 7 856
挽巷
挽巷 2020-12-14 08:10

After searching for many hours I am starting to think this is impossible.

I need to run Chrome through selenium using different authenticated (not public) proxy\'s f

相关标签:
7条回答
  • 2020-12-14 09:02

    I tryed lot of time to do the same.

    Chrome is using only proxy of the OS where it is installed. You can check it by going to options-> find: proxy -> change proxy settings

    So without additional addons and configuring this addons you cannot do this.

    Or you can change your OS proxy settings -- this is much easier.

    Also you can use phantomjs -- it have the same engine(WebKit) as chrome. using something like this:

    String PROXY = proxyIP + ":" + proxyPort;
    String proxyAuth= proxyUser + ":" + proxyPass;
            OpenQA.Selenium.Proxy proxy = new OpenQA.Selenium.Proxy();
                        proxy.HttpProxy = PROXY;
                        proxy.FtpProxy = PROXY;
                        proxy.SslProxy = PROXY;
                        proxy.SocksProxy = PROXY;
    
        var serviceJS = PhantomJSDriverService.CreateDefaultService(phantomPath);
        serviceJS.AddArguments("--proxy=" + PROXY, "--proxy-type=http", "--proxy-auth=" + proxyAuth);
    
    0 讨论(0)
提交回复
热议问题