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¶
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¶
- viewport - viewportSize seems not to work with PhantomJS - Stack Overflow
- Node.jsでフォルダ内の全HTMLをキャプチャし画像化 - Qiita
- javascript - phantomjs not waiting for "full" page load - Stack Overflow