PhantomJS
lastmod 2020-11-12created 2014-09-118 edits
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.
In short, it is a module that lets you control websites using the Webkit engine(QT) without a screen.
It is usually described as Scriptable Headless WebKit; here Headless doesn't mean "without a head" but "without a screen".
How to install
If Korean fonts are not installed on the system:
Screenshot
// screenshot.js
var page = require('webpage').create();
page.open('http://www.daum.net', function () {
page.render('daum.png');
phantom.exit();
});
Then run it as follows.
See also
Favorite site
- PhantomJS web site
- Phantomjs Preview Introduction
- javacript web scraping using beautiful Soup and PhantomJS (pubmed)
- Web screenshots using imagemagick and PhantomJS
- Solving a hypothetical business problem with PhantomJS and CasperJS
- Three ways to install PhantomJS on Ubuntu
- [Recommended] Fetching website data with Node.js (web scraping, Phantomjs) 1
References
-
Nodejs_and_Phantomjs_-_web_scraping.pdf ↩