Skip to content

Instantly share code, notes, and snippets.

@rhzs
Last active August 29, 2015 14:26
Show Gist options
  • Save rhzs/188e0ac7bfb1ff0782f4 to your computer and use it in GitHub Desktop.
Save rhzs/188e0ac7bfb1ff0782f4 to your computer and use it in GitHub Desktop.
Using phantomjs to take lazada landing page screenshot (and pull data later on)
// To run type:
// phantomjs lazada_take_screenshot.js
// Output:
// see lazada.png
// Gotchas: not all AJAX are fully loaded!
var page = require('webpage').create();
page.open('http://www.lazada.co.id/', function(status) {
console.log("Status: " + status);
if(status === "success") {
page.render('lazada.png');
}
phantom.exit();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment