Hide/Silence ChromeDriver window

前端 未结 3 1215
予麋鹿
予麋鹿 2020-12-14 18:25

When I launch Selenium\'s WebDriver (Chromedriver). A console window (chromedriver.exe) runs and it opens Chrome. I need to know how I can hide those like a silent mode beca

3条回答
  •  臣服心动
    2020-12-14 18:56

    As of Chrome 59, you can now also hide the chrome browser window by using headless mode:

    options.AddArgument("headless");
    

    and in combination with:

    ChromeDriverService service = ChromeDriverService.CreateDefaultService();
    service.HideCommandPromptWindow = true;
    

    it runs in complete silence.

提交回复
热议问题