fysh711426 / UndetectedChromeDriver

GNU General Public License v3.0
172 stars 65 forks source link

Proxy setup does not work #27

Open PatrikBak opened 1 year ago

PatrikBak commented 1 year ago

This code does not work:

var myProxy = "some proxy IP";
var options = new ChromeOptions
{
    Proxy = new OpenQA.Selenium.Proxy
    {
        Kind = OpenQA.Selenium.ProxyKind.Manual,
        HttpProxy = myProxy,
        SslProxy = myProxy,
        FtpProxy = myProxy,
        IsAutoDetect = false
    }
};
UndetectedChromeDriver
    .Create(options, driverExecutablePath: Path.GetFullPath("chromedriver.exe"))
    .GoToUrl("https://www.myip.com/");

even when it works with the classical ChromeDriver:

new ChromeDriver(options).GoToUrl("https://www.myip.com/");
fysh711426 commented 1 year ago

Use proxy.

options.AddArguments("--proxy-server=136.243.174.243:1080");
options.AddArguments("--proxy-server=socks5://136.243.174.243");

Reference source. https://github.com/ultrafunkamsterdam/undetected-chromedriver/issues/574#issuecomment-1088211225