How to print html source to console with phantomjs

Spent some time to read the documentation, it should be obvious afterwards.

var page = require('webpage').create();
page.open('http://google.com', function () {
    console.log(page.content);
    phantom.exit();
});

Leave a Comment