Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Chat_Bot
/
KaKao_ChatBot
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Authored by
윤준현
2018-12-04 23:19:35 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
018d6b6d5e28bea6d078da0cc2dd41aa49adcc24
018d6b6d
1 parent
426dab71
add yorusika
success
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 additions
and
80 deletions
crawling/Reol.js
crawling/Reol.js
View file @
018d6b6
...
...
@@ -62,83 +62,4 @@ function crawl_Reol(url,callback){
});
}
exports
.
crawl_Reol
=
crawl_Reol
;
// promise
// var request = require('request');
// var cheerio = require('cheerio');
// function crawl_Reol(url){
// return new Promise(function(resolve, reject){
// request(url, function (err, res, body) {
// const $ = cheerio.load(body);
// var Reol = new Array();
// var album, year
// var album_track = new Array();
// var json_album = new Array(), json_year = new Array(), json_track = new Array();
// $('body > div.content-wrapper > article > div.wiki-content.clearfix > div').each(function (index, ele) {
// for (var i = 1; i <= $('.toc-item').length; i++) {
// album = $(this).find('#toc > div > div:nth-child(2) > span:nth-child(' + i + ')').text() //앨범 정보 가져오기
// if (album != '') {
// json_album.push(album.substr(2));
// }
// var index = 7 + (i * 2); //트랙, 연도 가져오기 인덱스 변수
// if (index != 25) { //규칙성이 어긋나는 부분을 예외처리를 위해 if문
// //year 가져오기
// year = $('body > div.content-wrapper > article > div.wiki-content.clearfix > div > div:nth-child(' + index + ') > div:nth-child(3) > table > tbody > tr:nth-child(1) > td:nth-child(2)').text();
// //track 가져오기
// $('body > div.content-wrapper > article > div.wiki-content.clearfix > div > div:nth-child(' + index + ') > div:nth-child(3) > table > tbody').find('tr').each(function (index, ele) {
// var track = $(this).children().eq(1).text();
// if (track != '1' && track != '곡명' && track[4] != '년')
// album_track.push(track)
// });
// }
// else {
// year = $('body > div.content-wrapper > article > div.wiki-content.clearfix > div > div:nth-child(' + index + ') > div:nth-child(4) > table > tbody > tr:nth-child(1) > td:nth-child(2)').text();
// $('body > div.content-wrapper > article > div.wiki-content.clearfix > div > div:nth-child(' + index + ') > div:nth-child(4) > table > tbody').find('tr').each(function (index, ele) {
// var track = $(this).children().eq(1).text();
// if (track != '1' && track != '곡명' && track[4] != '년')
// album_track.push(track)
// });
// }
// if (year != '') {
// json_year.push(year);
// json_track.push(album_track);
// }
// album_track = [];
// }
// });
// Reol.push({ json_album, json_year, json_track });
// if (Reol) {
// resolve(Reol);
// }
// reject(new Error("Request is failed"));
// });
// });
// }
// exports.crawl_Reol = crawl_Reol;
\ No newline at end of file
exports
.
crawl_Reol
=
crawl_Reol
;
\ No newline at end of file
...
...
Please
register
or
login
to post a comment