Currently, I am utilizing phantomjs to capture screenshots of multiple webpages. The code snippet below is what I have used to generate a screenshot image.
var page = require('webpage').create();
page.viewportSize = { width: 1200,height: 800};
page.open('http://<randomwebpageAddress>', function(status) {
console.log(status);
console.log(page.render('screenshot.png'));
phantom.exit();
});
However, there are instances where the output for certain pages is as follows:
status = "success"
but the return value of page.render()
is false
This leads me to ask the following question:
Under what circumstances does page.render()
return false?