Toggle navigation
Toggle navigation
This project
Loading...
Sign in
전세계
/
FakerQuiz
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
1
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
전세계
2020-05-31 20:38:19 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
b5c872898078095f86e5da4ee8f1493ede15ddec
b5c87289
1 parent
32fc2d2a
기능: LCK 통산 전적 크롤링
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
3 deletions
app.js
app.js
View file @
b5c8728
...
...
@@ -4,10 +4,13 @@ const port = 80;
const
axios
=
require
(
'axios'
);
const
cheerio
=
require
(
'cheerio'
);
const
url
=
'http://lol.inven.co.kr/dataninfo/proteam/progamer.php?code=135'
;
var
fakerData
=
{};
const
getHTML
=
async
()
=>
{
try
{
return
await
axios
.
get
(
'http://lol.inven.co.kr/dataninfo/proteam/progamer.php?code=135'
);
return
await
axios
.
get
(
url
);
}
catch
(
error
)
{
console
.
error
(
error
);
}
...
...
@@ -16,9 +19,23 @@ const getHTML = async () => {
getHTML
()
.
then
(
html
=>
{
const
$
=
cheerio
.
load
(
html
.
data
);
var
title
=
$
(
"h2.block.name"
).
text
();
return
title
;
// LCK 통산 전적
var
tr
=
$
(
'table.table.log_list.log01 tbody'
).
children
();
var
td
=
tr
.
eq
(
0
).
children
();
fakerData
[
'lCK'
]
=
{
totalGamePlay
:
td
.
eq
(
1
).
text
(),
totalWin
:
td
.
eq
(
2
).
text
(),
totalLose
:
td
.
eq
(
3
).
text
(),
winRate
:
td
.
eq
(
4
).
text
(),
killPerMatch
:
td
.
eq
(
5
).
text
(),
deathPerMatch
:
td
.
eq
(
6
).
text
(),
assistPerMatch
:
td
.
eq
(
7
).
text
(),
kDA
:
td
.
eq
(
8
).
text
(),
killParticipation
:
td
.
eq
(
9
).
text
()
};
return
fakerData
;
})
.
then
(
res
=>
console
.
log
(
res
));
...
...
Please
register
or
login
to post a comment