Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
REMitchell
GitHub Repository: REMitchell/python-crawling
Path: blob/master/6-Selenium/phantomjs/examples/technews.js
164 views
1
var page = require('webpage').create();
2
page.viewportSize = { width: 320, height: 480 };
3
page.open('http://news.google.com/news/i/section?&topic=t', function (status) {
4
if (status !== 'success') {
5
console.log('Unable to access the network!');
6
} else {
7
page.evaluate(function () {
8
var body = document.body;
9
body.style.backgroundColor = '#fff';
10
body.querySelector('div#title-block').style.display = 'none';
11
body.querySelector('form#edition-picker-form').parentElement.parentElement.style.display = 'none';
12
});
13
page.render('technews.png');
14
}
15
phantom.exit();
16
});
17
18