Skip to content

Instantly share code, notes, and snippets.

Created October 14, 2016 19:28
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save eewee/ccdf2af7f6914fe702a02c727b318996 to your computer and use it in GitHub Desktop.
casperjs : screenshot
var casper = require('casper').create();
var utils = require('utils');
var urls = [
var i = 0;
casper.userAgent('Mozilla/5.0 (Macintosh; Intel Mac OS X)');
casper.each(urls, function(self, url){
casper.thenOpen(url, function(){
// Prendre une photo
this.viewport(1800, 1200);
this.viewport(1024, 768);
this.captureSelector('eewee_capture_'+i+'_1024x768.jpg', 'article');
this.viewport(800, 600);
this.captureSelector('eewee_capture_'+i+'_800x600.jpg', 'article');
this.viewport(400, 300);
this.captureSelector('eewee_capture_'+i+'_400x300.jpg', 'article');
this.echo( this.status(true) );
// Scroll
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment