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