I've been working on an app to crawl through a list of URLs and pull down the live source code (i.e. generated source instead of raw) - and I've used PhantomJS via Selenium.NET to do this as I wanted to have the operation done in a headless form.
The process itself works fine, but each time one of my threads loads an instance of the PhantomJS driver it runs PhantomJS.exe (as GhostDriver) in a newly opened console. I'd like to avoid this is possible as each time a thread starts the console windows are stealing focus on the machine. Does anyone know whether this is possible? I'm using a really basic snippet to launch the instance:
IWebDriver driver = new PhantomJSDriver();
driver.Manage().Timeouts().ImplicitlyWait(new TimeSpan(0, 0, 30));
driver.Navigate().GoToUrl(Entry);
///... Store HTML and do main work here ...
driver.Quit();
driver.Dispose();
Is there a way to hide the exe window via one of the additional capabilities that can be passed into the constructor, or a better way to load the instance via Process.Start etc..?
Any help would be appreciated as I can't seem to find any official documentation dealing with this issue for the .NET platform.
Thanks in advance!