Skip to content

Instantly share code, notes, and snippets.

@brendandahl
Created February 18, 2017 02:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brendandahl/6864ae09c46c54524b42d51583fac82e to your computer and use it in GitHub Desktop.
Save brendandahl/6864ae09c46c54524b42d51583fac82e to your computer and use it in GitHub Desktop.
Snapshot a page with slimer.js
var webpage = require('webpage').create();
webpage
.open('http://localhost:8000')
.then(function() {
// store a screenshot of the page
webpage.viewportSize = { width:650, height:320 };
webpage.render('/home/bdahl/projects/gecko/page.png',
{ onlyViewport:true });
slimer.exit();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment