전세계

형식: 코드 region화 및 자동정렬

Showing 1 changed file with 27 additions and 24 deletions
...@@ -20,47 +20,50 @@ getHTML() ...@@ -20,47 +20,50 @@ getHTML()
20 .then(html => { 20 .then(html => {
21 const $ = cheerio.load(html.data); 21 const $ = cheerio.load(html.data);
22 22
23 - // LCK 통산 전적 23 + //#region LCK 통산 전적
24 var tr = $('table.table.log_list.log01 tbody').children(); 24 var tr = $('table.table.log_list.log01 tbody').children();
25 var td = tr.eq(0).children(); 25 var td = tr.eq(0).children();
26 +
26 fakerData['lCK'] = { 27 fakerData['lCK'] = {
27 - totalGamePlay : td.eq(1).text(), 28 + totalGamePlay: td.eq(1).text(),
28 - totalWin : td.eq(2).text(), 29 + totalWin: td.eq(2).text(),
29 - totalLose : td.eq(3).text(), 30 + totalLose: td.eq(3).text(),
30 - winRate : td.eq(4).text(), 31 + winRate: td.eq(4).text(),
31 - killPerMatch : td.eq(5).text(), 32 + killPerMatch: td.eq(5).text(),
32 - deathPerMatch : td.eq(6).text(), 33 + deathPerMatch: td.eq(6).text(),
33 - assistPerMatch : td.eq(7).text(), 34 + assistPerMatch: td.eq(7).text(),
34 - kDA : td.eq(8).text(), 35 + kDA: td.eq(8).text(),
35 - kP : td.eq(9).text() 36 + kP: td.eq(9).text()
36 }; 37 };
38 + //#endregion
37 39
38 - // 최근 LCK 모스트 40 + //#region 최근 LCK 기록
39 var recentLCKInfo = $('div.block.scriptorium_box.scriptorium_player_info').children().eq(2); 41 var recentLCKInfo = $('div.block.scriptorium_box.scriptorium_player_info').children().eq(2);
40 var mostInfo = recentLCKInfo.find('div.left ul.block.list').children(); 42 var mostInfo = recentLCKInfo.find('div.left ul.block.list').children();
41 var mostList = []; 43 var mostList = [];
42 var indicatorInfo = recentLCKInfo.find('div.right ul.block.bottom.clearfix').children(); 44 var indicatorInfo = recentLCKInfo.find('div.right ul.block.bottom.clearfix').children();
43 45
44 - mostInfo.each(function (i, elem){ 46 + mostInfo.each(function (i, elem) {
45 mostList[i] = { 47 mostList[i] = {
46 - champion : $(this).find('div.name_area p.value b').text(), 48 + champion: $(this).find('div.name_area p.value b').text(),
47 - played : $(this).find('div.play_area p.value').text(), 49 + played: $(this).find('div.play_area p.value').text(),
48 - record : $(this).find('div.log_area p.value').text(), 50 + record: $(this).find('div.log_area p.value').text(),
49 - kDA : $(this).find('div.kda_area p.value').text() 51 + kDA: $(this).find('div.kda_area p.value').text()
50 } 52 }
51 }); 53 });
52 54
53 fakerData['recentLCK'] = { 55 fakerData['recentLCK'] = {
54 - name : recentLCKInfo.find('h3.block.player_sub_title.clearfix').text(), 56 + name: recentLCKInfo.find('h3.block.player_sub_title.clearfix').text(),
55 - most : mostList, 57 + most: mostList,
56 - comparison_WinRate : indicatorInfo.eq(0).find('div.progress.left div.text').text() 58 + comparison_WinRate: indicatorInfo.eq(0).find('div.progress.left div.text').text()
57 .concat(" ", indicatorInfo.eq(0).find('div.progress.right div.text').text()), 59 .concat(" ", indicatorInfo.eq(0).find('div.progress.right div.text').text()),
58 - comparison_KDA : indicatorInfo.eq(1).find('div.progress.left div.text').text() 60 + comparison_KDA: indicatorInfo.eq(1).find('div.progress.left div.text').text()
59 - .concat(" ", indicatorInfo.eq(1).find('div.progress.right div.text').text()), 61 + .concat(" ", indicatorInfo.eq(1).find('div.progress.right div.text').text()),
60 - comparison_KP : indicatorInfo.eq(2).find('div.progress.left div.text').text() 62 + comparison_KP: indicatorInfo.eq(2).find('div.progress.left div.text').text()
61 - .concat(" ", indicatorInfo.eq(2).find('div.progress.right div.text').text()) 63 + .concat(" ", indicatorInfo.eq(2).find('div.progress.right div.text').text())
62 }; 64 };
63 - 65 + //#endregion
66 +
64 return fakerData; 67 return fakerData;
65 }) 68 })
66 .then(res => console.log(res)); 69 .then(res => console.log(res));
......