Wednesday, February 17, 2016
Tuesday, February 16, 2016
Monday, February 15, 2016
Saturday, February 13, 2016
Phantom JS: Creating PNG Image File of the Specified URL
Creating PNG image file of the specified URL
pagerender.js:
var page = require('webpage').create(),
system = require('system'),
address;
if (system.args.length <= 2) {
console.log('Usage: pagerender.js <some URL> <image name>');
phantom.exit();
}
address = system.args[1];
image = system.args[2];
page.open(address, function(status) {
console.log("Status: " + status);
if(status === "success") {
page.render(image);
}
phantom.exit();
});
pagerender.js:
var page = require('webpage').create(),
system = require('system'),
address;
if (system.args.length <= 2) {
console.log('Usage: pagerender.js <some URL> <image name>');
phantom.exit();
}
address = system.args[1];
image = system.args[2];
page.open(address, function(status) {
console.log("Status: " + status);
if(status === "success") {
page.render(image);
}
phantom.exit();
});
Command:$ phantomjs pagerender.js http://smashingtheory.blogspot.com test.png
ラベル:
Headless browser
Thursday, February 11, 2016
Wednesday, February 10, 2016
Subscribe to:
Posts (Atom)