Skip to content

Instantly share code, notes, and snippets.

@kirkbackus
Last active August 29, 2015 14:25
Show Gist options
  • Save kirkbackus/76072165403a97608597 to your computer and use it in GitHub Desktop.
Save kirkbackus/76072165403a97608597 to your computer and use it in GitHub Desktop.
Google News Gist
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();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment