Created
April 2, 2015 05:43
-
-
Save gabhi/202c19dc12f5a3f54f12 to your computer and use it in GitHub Desktop.
phantonjs node js screenshot of a website
This file contains hidden or 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
| var phantom = require('phantom'); | |
| var website_name = "amazon.in"; | |
| var takeScreenShot = function(website_name) { | |
| phantom.create(function(ph) { | |
| ph.createPage(function(page) { | |
| page.open("http://" + website_name, function(status) { | |
| if (status === "success") { | |
| page.render("./images/"+website_name + '.png'); | |
| } | |
| ph.exit(); | |
| }); | |
| }); | |
| }); | |
| } | |
| takeScreenShot(website_name); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment