Last active
August 29, 2015 14:26
-
-
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)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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