Search code examples
.netbrowserphantomjsheadless

Headless webkit wrapper/driver no install for .net


I'm looking for an embedded headless browser for .net with the following properties:

  • Modern Webkit level of Ajax/HTML5 support and preferably webkit based
  • Headless mode capable (no visible browser), more speed it better
  • Zero install (something like browser.exe and a c# wrapper DLL copied into the project)
  • Reliable for production usage for basic tasks (like screen shots of complex pages), I'm not looking for 99.9999 reliability here, but it needs to be stabler and faster than Selenium, we have lots of redundancy so occasional bugs are ok.
  • OpenSource or free for commercial use (ideally MIT license) and not an abandoned project

PhantomJS would be ideal if it didn't require an install. PhantomJS seems to meet all my criteria other than the 'no install' part so it is the current favorite, but before we invest time in setting up and testing a multi environment deployment process for installing PhantomJS (which is time consuming because we use thousands of computers in dozens of datacenters) I wanted to make sure I'm not missing a better option. I'm open to non webkit implementations but it needs to have the same capabilities as a modern webkit browser and not have oddball rendering or AJAX problems. I'm also interested in hearing about the reliability of PhantomJS for screen shotting AJAX/HTML5 pages if you think that's the way to go. For example, if the server rendering the page doesn't have a graphics card or high screen resolution will the headless browser inherit that and render a ugly looking page?


Solution

  • PhantomJS can be installs simply by extracting the zip to get the exe. So it's pretty simple in that regard.

    Not sure so much about a c# dll for it as I've not worked with it in.net, but it can be scripted from an external program (that's kinda the whole point of it), so it shouldn't be too hard.

    Hope that helps.