0

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;
}
DeadUnicorn
  • 175
  • 1
  • 12
  • 1
    It is not clear currently what you ask. Is it a PhantomJS script? Is it a node.js script? What result do you need? Where do you want to return it to? – Vaviloff Feb 21 '18 at 02:09

1 Answers1

0

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);})

Guru
  • 411
  • 3
  • 20