Skip to content

PhantomJS

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.
http://phantomjs.org

Get Started

Download | PhantomJS

OS X

$ brew install phantomjs

Quick Start

not a library, but a command

$ phantomjs
phantomjs> require('webpage');
{
   "create": "[Function]"
}
phantomjs>

Screen Capture

utils/phantomjs-capture at master · syon/utils

official docs

  • Screen Capture | PhantomJS

    PhantomJS can render anything on the web page, it can be used to convert contents not only in HTML and CSS, but also SVG and Canvas.

  • viewportSize | PhantomJS
    Viewportサイズの指定であって、出力画像のpxサイズ指定ではないことに注意

articles

Page Automation