Setting a proxy for Chrome Driver in Selenium

前端 未结 3 1101
情歌与酒
情歌与酒 2020-12-03 11:05

I am using Selenium Webdriver using C# for Automation in Chrome browser. I need to check if my webpage is bloced in Some regions(some ip ranges). So I have to set a proxy in

3条回答
  •  青春惊慌失措
    2020-12-03 12:03

    I'm using the nuget packages for Selenium 2.50.1 with this:

    ChromeOptions options = new ChromeOptions();
    proxy = new Proxy();
    proxy.Kind = ProxyKind.Manual;
    proxy.IsAutoDetect = false;
    proxy.HttpProxy =
    proxy.SslProxy = "127.0.0.1:3330";
    options.Proxy = proxy;
    options.AddArgument("ignore-certificate-errors");
    var chromedriver = new ChromeDriver(options);
    

提交回复
热议问题