Toggle navigation
Toggle navigation
This project
Loading...
Sign in
정승우
/
YaguMoa
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
SW0000J
2020-06-06 18:51:41 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
bfa1cb36d7fbaa7c385db2308d43a1edfd0b492f
bfa1cb36
1 parent
d717074c
연합뉴스(app.js 수정)
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
app.js
app.js
View file @
bfa1cb3
const
axios
=
require
(
"axios"
);
const
cheerio
=
require
(
"cheerio"
);
const
url
=
"https://www.yna.co.kr/sports/baseball"
const
getHtml
=
async
()
=>
{
try
{
return
await
axios
.
get
(
"https://www.yna.co.kr/sports/baseball"
);
return
await
axios
.
get
(
url
);
}
catch
(
error
)
{
console
.
error
(
error
);
}
...
...
@@ -21,7 +23,7 @@ getHtml()
image_url
:
$
(
this
).
find
(
'figure.img-con a'
).
attr
(
'href'
),
url
:
$
(
this
).
find
(
'div.news-con a'
).
attr
(
'href'
),
title
:
$
(
this
).
find
(
'div.news-con strong'
).
text
(),
summary
:
$
(
this
).
find
(
'div.news-con p'
).
text
()
.
slice
(
0
,
-
29
)
summary
:
$
(
this
).
find
(
'div.news-con p'
).
text
()
};
//console.log(ulList[i]) // list object checking code
});
...
...
Please
register
or
login
to post a comment