Skip to content

Instantly share code, notes, and snippets.

@c18t
Created December 5, 2013 20:15
Show Gist options
  • Save c18t/7813082 to your computer and use it in GitHub Desktop.
Save c18t/7813082 to your computer and use it in GitHub Desktop.
phantomjs でスクリーンショットとってみた $ phantomjs capture_website.js http://google.com/
var system = require('system');
var page = require('webpage').create();
var timezone = +9 * 60 * 60 * 1000;
if (system.args.length === 1) {
console.log('Try to pass one url that you want to capture!');
phantom.exit();
} else {
console.log('start capturing: ' + system.args[1]);
page.open(system.args[1], function() {
window.setTimeout(function() {
var filename = 'capture-'+(new Date(Date.now()+timezone).toISOString().replace(/:/g,'-').replace(/Z$/,''))+'.png';
page.render(filename);
console.log('save as: '+filename);
phantom.exit();
}, 200);
});
}
@c18t
Copy link
Author

c18t commented Dec 5, 2013

とってみたやつ
google.comのスクリーンショット

@c18t
Copy link
Author

c18t commented Dec 6, 2013

slimerjsでとってみた。くずれましたね
slimserjsでgoogle.comのスクリーンショット

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment