HTTP/2 200
server: GitHub.com
content-type: text/html; charset=utf-8
last-modified: Wed, 26 Feb 2020 03:49:53 GMT
access-control-allow-origin: *
etag: W/"5e55eae1-a6b"
expires: Mon, 29 Dec 2025 23:30:19 GMT
cache-control: max-age=600
content-encoding: gzip
x-proxy-cache: MISS
x-github-request-id: ABB6:3946E9:957389:A7DA53:69530CB3
accept-ranges: bytes
age: 0
date: Tue, 30 Dec 2025 04:21:46 GMT
via: 1.1 varnish
x-served-by: cache-bom-vanm7210048-BOM
x-cache: HIT
x-cache-hits: 0
x-timer: S1767068506.382424,VS0,VE201
vary: Accept-Encoding
x-fastly-request-id: 931445a62bffe85b9dcc6dc5465695e09d7af7e7
content-length: 1327
PhantomJS - Scriptable Headless Browser
PhantomJS - Scriptable Headless Browser
Important: PhantomJS development is suspended until further notice (more details).
PhantomJS is a headless web browser scriptable with JavaScript. It runs on Windows, macOS, Linux, and FreeBSD.
Using QtWebKit as the back-end, it offers fast and native support for various web standards: DOM handling, CSS selector, JSON, Canvas, and SVG.
The following simple script for PhantomJS loads Google homepage, waits a bit, and then captures it to an image.
var page = require('webpage').create();
page.open('https://www.google.com', function() {
setTimeout(function() {
page.render('google.png');
phantom.exit();
}, 200);
});
PhantomJS is an optimal solution for:
Page automation
Access webpages and extract information using the standard DOM API, or with usual libraries like jQuery.
Screen capture
Programmatically capture web contents, including SVG and Canvas. Create web site screenshots with thumbnail preview.
Headless website testing
Run functional tests with frameworks such as Jasmine, QUnit, Mocha, WebDriver, etc.
Network monitoring
Monitor page loading and export as standard HAR files. Automate performance analysis using YSlow and Jenkins.
Ready to play with PhantomJS? Install and follow the Quick Start guide.
Want to learn more? Read the FAQ,
explore more examples, and study the complete API documentation.
For the source code, issue tracker, and other development information, visit github.com/ariya/phantomjs.