0

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?

Clifford
  • 88,407
  • 13
  • 85
  • 165
Glenn
  • 1,234
  • 2
  • 19
  • 33
  • 1
    PhantomJS is a simple case of extracting the zip file to get at the exe. Not sure how you could have software that was simpler to install than that. – Spudley Oct 06 '12 at 16:29
  • that's great news! This article suggested otherwise. Maybe it was out of date or incorrect http://skookum.com/blog/dynamic-screenshots-on-the-server-with-phantomjs/ If you are sure that no install is required and we can just call the exe directly to open a headless browser, then if you want to post under answer I will accept it – Glenn Oct 06 '12 at 17:01
  • I guess the reason the article makes it sound difficult is that it was written a while ago. Phantomjs is quite new, and it's only the last few revisions that it's started to become a usable tool without making you jump through too many hoops. Quite possibly it wasn't available as a pre-compiled binary when he tried it. It certainly is now, and that makes it dead easy. – Spudley Oct 06 '12 at 19:35

1 Answers1

2

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.

Spudley
  • 166,037
  • 39
  • 233
  • 307
  • This sounds a good fit, thanks for the quick reply. So, just confirming, the exe is actually the PhantomJS application and not an installer right? What about webkit? do we have to do any webkit dependency installs? hoping for a 'just call this exe and it works' kind of thing :-) – Glenn Oct 06 '12 at 18:11
  • 1
    Yes, the exe is the full app, and it's statically linked so it contains everything it needs within the exe -- see also http://phantomjs.org/download.html - to quote: `Download... and extract... The executable bin/phantomjs.exe is ready to use.` – Spudley Oct 06 '12 at 19:29
  • thanks! it looks like the confusion in that article came from the fact that he was targeting a source build rather than using a standard package. – Glenn Oct 07 '12 at 19:06
  • 1
    http://phantomjs.org/download.html already says it all: "For this static build, the binary is self-contained with no external dependency. It will run on a fresh install of Windows XP or later versions. There is no requirement to install Qt, WebKit, or any other libraries." – Ariya Hidayat Oct 08 '12 at 17:47