Full web stack
No browser required

PhantomJS is a headless WebKit scriptable with a JavaScript API. It has fast and native support for various web standards: DOM handling, CSS selector, JSON, Canvas, and SVG.

Download v2.1 Get started

// Simple Javascript example

console.log('Loading a web page');
var page = require('webpage').create();
var url = '';, function (status) {
  //Page is loaded!


PhantomJS is an optimal solution for

Headless Website Testing

Run functional tests with frameworks such as Jasmine, QUnit, Mocha, Capybara, WebDriver, and many others. Learn more

Screen Capture

Programmatically capture web contents, including SVG and Canvas. Create web site screenshots with thumbnail preview. Learn more

Page Automation

Access and manipulate webpages with the standard DOM API, or with usual libraries like jQuery.
Learn more

Network Monitoring

Monitor page loading and export as standard HAR files. Automate performance analysis using YSlow and Jenkins. Learn more

Fork PhantomJS on GitHub