I want to save my special web pages after document loaded into special file name via all url and links convert to absolute url such as wget -k
.
//phantomjs
var page = require('webpage').create();
var url = 'http://google.com/';
page.open(url, function (status) {
var js = page.evaluate(function () {
return document;
});
console.log(js.all[0].outerHTML);
phantom.exit();
});
for example my html content somthing like this:
<a href="//page.html">page</a>
must be
<a href="http://google.com/page.html">page</a>
It's my sample script but how can i convert all url and links such as wget -k
using phantomjs?