정태규

Update zum

This diff is collapsed. Click to expand it.
......@@ -8,8 +8,5 @@
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"crawler": "^1.3.0"
}
"license": "ISC"
}
......
var Crawler = require("crawler");
var c = new Crawler({
maxConnections : 10,
callback : function (error, res, done) {
......@@ -7,18 +7,21 @@ var c = new Crawler({
console.log(error);
} else{
var $ = res.$;
console.log('ZUM ' + $("title").text());
let List = [];
List[0] = 'zum NOW 이슈 검색어';
const $bodyList1 = $("div.realtime_wrap").children("div.inner_box");
const $bodyList2 = $("ul.slide_words_list li").children("div.cont");
console.log('< ' + $bodyList1.find('span.time_data').text() + ' >');
List[1] =('< ' + $bodyList1.find('span.time_data').text() + ' >');
$bodyList2.each(function(i, elem) {
console.log((i + 1) + ". " + $(this).find('span.word').text());
List[i + 2] = ((i + 1) + ". " + $(this).find('span.word').text());
});
console.log(List);
}
done();
}
});
c.queue('https://issue.zum.com/');
......