Skip to content

Instantly share code, notes, and snippets.

@azu
Created January 23, 2011 08:01
Show Gist options
  • Save azu/791907 to your computer and use it in GitHub Desktop.
Save azu/791907 to your computer and use it in GitHub Desktop.
#phantomJS でscreenshotを撮る
//$ phantomjs.exe screenshot.js http://d.hatena.ne.jp/unageanu/20110123/1295759061
if (phantom.state.length === 0) {
var address = phantom.args[0];
phantom.state = 'ss';
phantom.viewportSize = { width: 480, height: 600 };
phantom.open(address);
} else {
phantom.render('screenshot.png');
phantom.exit();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment