Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
REMitchell
GitHub Repository: REMitchell/python-crawling
Path: blob/master/6-Selenium/phantomjs/examples/movies.js
164 views
1
// List movies from kids-in-mind.com
2
3
var cbfunc = function (data) {
4
globaldata= data;
5
var list = data.query.results.movie;
6
list.forEach(function (item) {
7
console.log(item.title + ' [' + item.rating.MPAA.content + ']');
8
});
9
phantom.exit();
10
};
11
12
var el = document.createElement('script');
13
el.src = 'http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20movies.kids-in-mind&format=json&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys&callback=cbfunc';
14
document.body.appendChild(el);
15
16