Wow. Congrats on finally going completely headless on Linux. That's a big deal.
This makes it the first modern browser replacement for our old moz-headless-screenshot branch, which is effectively Firefox 3.6. It's really a shame no-one's picked up that work for modern FF builds. Couldn't even find someone to hire for it...
While it does kinda suck if your usecase needs Flash, I think the reasoning was solid. Being able to truly run headless in a barebones command line environment is more important than supporting Flash, in its waning years.
Then, of course, there's also this:
Issues are reported but nobody volunteers to analyze or fix them
The main advantage of Selenium is that it allows you to test cross-platform compatibility, since it can be configured to run on pretty much every major browser/OS combo.
For everything other than that, though, PhantomJS is fantastic. It's infinitely more pleasant to deal with than Selenium.
If you are currently using Rhino to run Javascript then PhantomJS makes for an excellent and more functional replacement.
In addition to running library unit tests in a 'real' browser environment it can also be used to test apis and visual components, and then save results as files and screenshots for use with other systems such as Hudson.
I use it extensively for our web app build and test cycle at work (Causata.com) and to save time for anyone interested in rolling their own have made the code available on Github at https://github.com/metafeather/phantomjs-yuitest
I have been surprised that this project has seemed to fly under the radar for so long. It's extremely useful in a variety of scenarios, and as far as I know, it is unique in its capabilities.
I've used it to allow modern applications to interface with legacy systems that have no mechanism of extension, and no API other than their web interfaces. Just about anything you can control via a web interface, you (or your software) can control using PhantomJS.
For the superior completely headless qualities? There was a post on HN almost 400 days ago where someone claimed wkhtmltopdf's PDF output quality was superior to phantomjs - anyone know if that's changed with this release?
In my experience, using jsdom (and other similar node.js DOM libraries) is fine for scraping static content, but tends to fall down when you're dealing with anything that requires executing client-side JS. That's a big deal if you're scraping sites that load in content via XHR, or manipulate CSRF tokens in JS specifically to throw off static scrapers. Both of these are use cases that PhantomJS has handled beautifully for me in the past.
Those are just scraping tools. phantom is a browser, what your scripts see are exactly what the user would see. Makes it great for test automation. Casperjs is a fork focusing on testing.
I built a scraper that was nodejs and nowjs that sent instructions to a javascript bot I injected into the page rendered by phantomjs, the bot then scraped and sent snippets back to the server again via nowjs. The real win for me was it was a comet + ajax target which is usually hard to scrape efficiently but I just synced the bot with the comet updates and away we go. Also being headless I could just spin up 20 instances without any performance problems on a cheap rack server.
For example, if you need to scrape the DOM content for content loaded dynamically by JavaScript, PhantomJS will allow you to do the job. Or take snapshots of Web sites as they appear to users.
After having read the installation guide on Windows for Phantom.js and WebServer, that is embedded in it, apparently installing the first to use the second is a lot simpler!
[+] [-] vitovito|14 years ago|reply
This makes it the first modern browser replacement for our old moz-headless-screenshot branch, which is effectively Firefox 3.6. It's really a shame no-one's picked up that work for modern FF builds. Couldn't even find someone to hire for it...
[+] [-] davedx|14 years ago|reply
[+] [-] DanielRibeiro|14 years ago|reply
So sad to hear this. That was my main motivation for using PhantomJS. Fortunately 1.4 still supports it.
[+] [-] veidr|14 years ago|reply
Then, of course, there's also this:
[+] [-] alexchamberlain|14 years ago|reply
[+] [-] wildmXranat|14 years ago|reply
To make a comparison for our heavy Selenium use, I can't clearly see what is lacking in PhantomJS that would be a show stopper.
Does anybody know if other than lack of Flash support, it covers all aspects of what the end user would experience ?
[+] [-] lazerwalker|14 years ago|reply
For everything other than that, though, PhantomJS is fantastic. It's infinitely more pleasant to deal with than Selenium.
[+] [-] iamleppert|14 years ago|reply
[+] [-] antrover|14 years ago|reply
CasperJS is built on top of PhantomJS and adds some cool assertions: http://casperjs.org/
[+] [-] programminggeek|14 years ago|reply
[+] [-] ZitchDog|14 years ago|reply
[+] [-] metafeather|14 years ago|reply
In addition to running library unit tests in a 'real' browser environment it can also be used to test apis and visual components, and then save results as files and screenshots for use with other systems such as Hudson.
I use it extensively for our web app build and test cycle at work (Causata.com) and to save time for anyone interested in rolling their own have made the code available on Github at https://github.com/metafeather/phantomjs-yuitest
[+] [-] veidr|14 years ago|reply
I've used it to allow modern applications to interface with legacy systems that have no mechanism of extension, and no API other than their web interfaces. Just about anything you can control via a web interface, you (or your software) can control using PhantomJS.
[+] [-] mk4p|14 years ago|reply
[+] [-] ricardobeat|14 years ago|reply
[+] [-] LogicX|14 years ago|reply
For the superior completely headless qualities? There was a post on HN almost 400 days ago where someone claimed wkhtmltopdf's PDF output quality was superior to phantomjs - anyone know if that's changed with this release?
[+] [-] boundlessdreamz|14 years ago|reply
http://code.google.com/p/phantomjs/wiki/ReleaseNotes
Search for "rasterization"
[+] [-] hengli|14 years ago|reply
[+] [-] lazerwalker|14 years ago|reply
[+] [-] MatthewPhillips|14 years ago|reply
[+] [-] weego|14 years ago|reply
[+] [-] jeromeparadis|14 years ago|reply
[+] [-] scriptproof|14 years ago|reply
[+] [-] maslam|14 years ago|reply
[+] [-] rgarcia|14 years ago|reply
[+] [-] skeletonjelly|14 years ago|reply
[+] [-] unknown|14 years ago|reply
[deleted]
[+] [-] sxtxixtxcxh|14 years ago|reply
[+] [-] sxtxixtxcxh|14 years ago|reply
[+] [-] boundlessdreamz|14 years ago|reply
[+] [-] dkhenry|14 years ago|reply
[+] [-] meow|14 years ago|reply
[+] [-] unknown|14 years ago|reply
[deleted]