I'm using PhantomJS to get some datas from WebSites and as a sample for my goal, I've made this:
var page=require('webpage').create();
page.open('http://www.phantomjs.org',function() {
var my_data=page.evaluate(function() {
var my_data=document.getElementsByTagName('h1').innerText;
return my_data;
});
console.log(my_data);
phantom.exit();
});
But this code is not working. Command prompt prints out only 'null'. What have I missed at here?