硒c#代理

时间:2019-05-09 14:21:31

标签: c# selenium

所以我打开了25个实例,它们都可以与代理正常工作,然后当程序关闭一个实例并打开一个新实例时,卡住了。

ChromeOptions options = new ChromeOptions();
ChromeDriverService service = 
ChromeDriverService.CreateDefaultService("chromedriver.exe");
service.SuppressInitialDiagnosticInformation = true;
service.HideCommandPromptWindow = true;
options.AddArgument("--silent");
options.AddArgument("--log-level 3");
options.AddArgument("--disable-extensions");
options.AddArgument("--ignore-certificate-errors");
options.AddArgument("--mute-audio");
Proxy proxy = new Proxy();
proxy.Kind = ProxyKind.Manual;
proxy.IsAutoDetect = false;
proxy.HttpProxy =
proxy.SslProxy = Proxy;
options.Proxy = proxy;
options.AddArgument("ignore-certificate-errors");
options.SetLoggingPreference(LogType.Browser, LogLevel.All);
IWebDriver driver = new ChromeDriver(service, options);
driver.Manage().Timeouts().PageLoad = TimeSpan.FromSeconds(60);

0 个答案:

没有答案