전세계

기능: 최근 LCK 기록 크롤링

Showing 1 changed file with 27 additions and 1 deletions
......@@ -32,9 +32,35 @@ getHTML()
deathPerMatch : td.eq(6).text(),
assistPerMatch : td.eq(7).text(),
kDA : td.eq(8).text(),
killParticipation : td.eq(9).text()
kP : td.eq(9).text()
};
// 최근 LCK 모스트
var recentLCKInfo = $('div.block.scriptorium_box.scriptorium_player_info').children().eq(2);
var mostInfo = recentLCKInfo.find('div.left ul.block.list').children();
var mostList = [];
var indicatorInfo = recentLCKInfo.find('div.right ul.block.bottom.clearfix').children();
mostInfo.each(function (i, elem){
mostList[i] = {
champion : $(this).find('div.name_area p.value b').text(),
played : $(this).find('div.play_area p.value').text(),
record : $(this).find('div.log_area p.value').text(),
kDA : $(this).find('div.kda_area p.value').text()
}
});
fakerData['recentLCK'] = {
name : recentLCKInfo.find('h3.block.player_sub_title.clearfix').text(),
most : mostList,
comparison_WinRate : indicatorInfo.eq(0).find('div.progress.left div.text').text()
.concat(" ", indicatorInfo.eq(0).find('div.progress.right div.text').text()),
comparison_KDA : indicatorInfo.eq(1).find('div.progress.left div.text').text()
.concat(" ", indicatorInfo.eq(1).find('div.progress.right div.text').text()),
comparison_KP : indicatorInfo.eq(2).find('div.progress.left div.text').text()
.concat(" ", indicatorInfo.eq(2).find('div.progress.right div.text').text())
};
return fakerData;
})
.then(res => console.log(res));
......