问题如下:
Error converting value "OpenQA.Selenium.WebDriverException: The HTTP request to the remote WebDriver server for URL http://localhost:60428/session/42277796c94c6a00778b4863cf27c37d/url timed out after 60 seconds. ---> System.Net.WebException: The operation has timed out.
解决方法如下:
注意标红的那2行
ChromeOptions chromeOptions = new ChromeOptions(); chromeOptions.AddArgument("no-sandbox"); chromeOptions.AddArguments("headless");//隐藏google IWebDriver webDriver = new ChromeDriver(ChromeDriverService.CreateDefaultService(), chromeOptions, TimeSpan.FromMinutes(3));