This gist is an updated version of https://github.com/ariya/phantomjs/blob/master/examples/technews.js
To run, just type (in a command line)
phantomjs news.js
This gist is an updated version of https://github.com/ariya/phantomjs/blob/master/examples/technews.js
To run, just type (in a command line)
phantomjs news.js
var page = require('webpage').create(); | |
page.viewportSize = { width: 480, height: 720 }; | |
page.open('http://news.google.com/news/section?&topic=tc', function (status) { | |
if (status !== 'success') { | |
console.log('Unable to access the network!'); | |
} else { | |
page.evaluate(function () { | |
var body = document.body; | |
body.style.backgroundColor = '#fff'; | |
body.querySelector('div#page-header').style.display = 'none'; | |
body.querySelector('div.google-one-wrapper').style.display = 'none'; | |
body.querySelector('div.section-header').style.display = 'none'; | |
body.querySelector('td.st-col').style.display = 'none'; | |
body.querySelector('td.rt-col').style.display = 'none'; | |
}); | |
page.render('technews.png'); | |
} | |
phantom.exit(); | |
}); |