DeadUnicorn
DeadUnicorn

Reputation: 175

How can I access to page.open function result? phantomjs

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

Answers (1)

Guru
Guru

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

Related Questions