전세계

기능: 챔피언 별 전적 크롤링

Showing 1 changed file with 29 additions and 1 deletions
...@@ -109,7 +109,35 @@ getHTML() ...@@ -109,7 +109,35 @@ getHTML()
109 list: competitionList 109 list: competitionList
110 } 110 }
111 //#endregion 111 //#endregion
112 - 112 +
113 + //#region 챔피언 별 전적
114 + var tr = $('div.scriptorium').children('div.listTable').eq(4).find('table tbody').children();
115 + var championData = {};
116 +
117 + tr.each(function (i, elem) {
118 + var td = $(this).children();
119 + var championName = td.eq(0).text();
120 +
121 + championData[championName] = {
122 + name: championName,
123 + totalGamePlay: td.eq(1).text(),
124 + totalWin: td.eq(2).text(),
125 + totalLose: td.eq(3).text(),
126 + winRate: td.eq(4).text(),
127 + totalKill: td.eq(5).text(),
128 + totalDeath: td.eq(6).text(),
129 + totalAssist: td.eq(7).text(),
130 + killPerMatch: td.eq(8).text(),
131 + deathPerMatch: td.eq(9).text(),
132 + assistPerMatch: td.eq(10).text(),
133 + kDA: td.eq(11).text(),
134 + kP: td.eq(12).text()
135 + }
136 + });
137 +
138 + fakerData['champions'] = championData;
139 + //#endregion
140 +
113 return fakerData; 141 return fakerData;
114 }) 142 })
115 .then(res => console.log(res)); 143 .then(res => console.log(res));
......