Get a snapshot by using phantomJS, snapshotphantomjs
Here is the source code about obtain a snapshot of a website by using phantomJS.
var webPage = require("webpage"), address, filename, height, width; // generate webPage objectvar page = webPage.create(); // generate one pagevar system = require("system"); // generate system object to obtain parametersvar args = system.args; // get the number of input parametersconsole.log("number is " + args.length);if(args.length !== 5){ // if the number of parameters is not correct exitconsole.log("the correct format is: address filename height width");phantom.exit();}console.log(args[0]);address = system.args[1];output = system.args[2];height = system.args[3];width = system.args[4];console.log(address + " " + output + " " + height + " " + width);page.viewportSize = {height:height, width:width}; // get the size of snapshotpage.open(address, function start(status){console.log(status);if(status === "success"){ // conduct the snapshot operationpage.render(output);}phantom.exit(); // exit the programme