Skip to content

Instantly share code, notes, and snippets.

@mickaelandrieu
Created May 17, 2014 15:10
Show Gist options
  • Save mickaelandrieu/e8f9d170c0a7e08f08f8 to your computer and use it in GitHub Desktop.
Save mickaelandrieu/e8f9d170c0a7e08f08f8 to your computer and use it in GitHub Desktop.
How to capture multiples images with the same class with CasperJS ?
var clipRects = this.getElementsBounds('.list_item img.poster');
var i = 0;
clipRects.forEach(function(clipRect) {
casper.capture(i+'.png', clipRect);
i++;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment