我正在使用 Selenium PhantomJS Webdriver 在我的 C# 应用程序中抓取页面。我经常使用控制台,所以我想关闭它不断输出的 INFO 消息。有人有同样的问题吗?
最佳答案
我认为必须将此字符串添加到 Wasp 答案中:
service.HideCommandPromptWindow = true;
所以
static IWebDriver CreateInfolessPhantom(string logFilePath)
{
PhantomJSDriverService service = PhantomJSDriverService.CreateDefaultService();
service.LogFile = logFilePath;
service.HideCommandPromptWindow = true;
return new PhantomJSDriver(service);
}
关于c# - 在 PhantomJS Selenium Webdriver 中关闭 INFO,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24956233/