【发布时间】:2018-06-03 13:02:03
【问题描述】:
我正在尝试使用 Selenium 与无头参数建立与 Google 的连接,因为我不想弹出网络浏览器。 这就是我得到的 This is what it looks like
public static void Main(string[] args)
{
LoadPage();
}
private static void LoadPage()
{
string path = @"C:\Users\Dev\Documents\";
ChromeOptions option = new ChromeOptions();
IWebDriver _driver;
option.AddArgument("--headless");
_driver = new ChromeDriver(path, option);
_driver.Navigate().GoToUrl("http://Google.com");
Console.WriteLine("Done");
}
如何确保我确实连接到 Google?
【问题讨论】:
-
从页面中读取一些内容并输出?
-
@gilliduck 所以它确实建立了连接,关于只有本地连接的全部内容..
-
不记得了,但我相信这很正常。如果这样做成功了,我会尽快将其添加为您接受的答案。
标签: c# .net google-chrome selenium chromium