Selenium遇到的问题记录:“The operation has timed out”


问题如下:

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));

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM