Skip to content

Instantly share code, notes, and snippets.

@lyhcode
Last active May 10, 2018 18:12
Show Gist options
  • Save lyhcode/6d7e8d0748333bbb0ae7bc1913f97e4d to your computer and use it in GitHub Desktop.
Save lyhcode/6d7e8d0748333bbb0ae7bc1913f97e4d to your computer and use it in GitHub Desktop.
var system = require('system');
var url = system.args[1];
var filename = system.args[2];
var page = new WebPage();
page.viewportSize = {
width: 1920,
height: 1080
};
page.clipRect = {
top: 0,
left: 0,
width: 1920,
height: 1080
};
page.settings.userAgent = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36';
page.open(url, function (status) {
page.render(filename);
phantom.exit();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment