Skip to content

Instantly share code, notes, and snippets.

@brian-gates
Last active August 29, 2015 14:07
Show Gist options
  • Save brian-gates/fc30b4a8a1ca94f94265 to your computer and use it in GitHub Desktop.
Save brian-gates/fc30b4a8a1ca94f94265 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 : 'localhost',
path : '/'
});
phantom.addCookie({
name : 'user_id',
value : '4d192380-0ba5-11e4-aea7-e55bf98ae31b',
domain : 'localhost',
path : '/'
});
var url = 'http://localhost:8000/reports/acquisition/2014-09-27';
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