Multiple screen capture with PhantomJS
- PhantomJSで複数画面キャプチャ

Tweet about this on TwitterShare on Facebook0Share on LinkedIn0Share on Google+0

Single page

If you want to capture a single page with PhantomJS, code as follows.
It’s better to add “page.evaluate()” because the generated files will be of transparent background color.

Then, run phantom.

Multiple pages

Sometimes you want to capture whole pages for your project.
This case will be solved with the followings.

This script saves .png files in html file names and handles html files in absolute path.

Leave a Comment.