Reputation: 175
How can I get access to the result that is returned from the callback?
var page = require('webpage').create();
page.open('http://example.com', function (status) {
// code
return result;
}
Upvotes: 0
Views: 211
Reputation: 440
If you need a screenshot of the page, use page.render('example.pdf')
. If you need the raw html data use page.evaluate(function(){
return document.documentElement.innerHTML;
},function(rawData){
console.log(rawData);})
Upvotes: 0