OpenQA.Selenium.WebDriverException:“The HTTP request to the remote WebDriver server for URL http://localhost:xxxx/session timed out after 60 seconds.”
1.在谷歌浏览器上加上中括号中的内容[ --remote-debugging-port=9222]
2.使用管理员模式打开谷歌浏览器
3.重新生成并启动程序
ChromeOptions options = new ChromeOptions()
{
DebuggerAddress = "127.0.0.1:9222"
};
using (ChromeDriver driver = new ChromeDriver(options))
{
driver.Navigate().GoToUrl("https://www.baidu.com");
}