Skip to content

Instantly share code, notes, and snippets.

@brian-gates
Created October 1, 2014 22:38
Show Gist options
  • Save brian-gates/74870e98706f96f27d79 to your computer and use it in GitHub Desktop.
Save brian-gates/74870e98706f96f27d79 to your computer and use it in GitHub Desktop.
var WebPage = require('webpage');
page = WebPage.create();
page.viewportSize = { width: 1920, height: 1200 };
phantom.addCookie({
name : 'access_token',
value : '08cd1e32-16dd-4b99-b976-e3bb8c922421',
domain : '/',
});
var url = 'http://localhost:8000/reports/acquisition/1411772400000';
page.open(url);
page.onLoadFinished = function() {
page.render('screenshot.pdf');
phantom.exit();
};
page.onConsoleMessage = function(msg, lineNum, sourceId) {
console.log(msg);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment