Toggle navigation
Toggle navigation
This project
Loading...
Sign in
김대선
/
Recruitment_Information_chatbot
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
김대선
2021-06-05 19:25:39 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
c2be808fb9554f4d046404847e63ab078011301c
c2be808f
1 parent
34441adb
KakaoFunction.js 수정 및 puppeteer timeouterror 수정
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
13 deletions
functions/kakaoFunction.js
functions/naverFunction.js
functions/programmersFunction.js
functions/kakaoFunction.js
View file @
c2be808
...
...
@@ -32,24 +32,19 @@ const makeObject = (array)=>{
return
result
}
const
moveNextPage
=
async
(
page
)
=>
{
await
page
.
click
(
'#mArticle > div > div.paging_list > span > a:nth-child(10) > span > span'
).
catch
((
error
)
=>
{
})
await
page
.
waitForTimeout
(
1000
)
return
await
page
.
content
()
}
const
getData
=
async
()
=>
{
const
browser
=
await
puppeteer
.
launch
();
const
page
=
await
browser
.
newPage
();
page
.
setDefaultNavigationTimeout
(
0
)
let
result
=
[]
let
temp
=
""
let
count
=
1
await
page
.
goto
(
'https://careers.kakao.com/jobs'
)
let
content
=
await
page
.
content
()
let
content
=
""
while
(
true
){
await
page
.
goto
(
`https://careers.kakao.com/jobs?page=
${
count
}
`
)
content
=
await
page
.
content
()
if
(
temp
==
content
){
break
;
}
...
...
@@ -66,12 +61,12 @@ const getData = async ()=>{
resArr
.
pop
()
result
=
result
.
concat
(
await
makeObject
(
resArr
))
temp
=
content
co
ntent
=
await
moveNextPage
(
page
)
co
unt
=
count
+
1
}
console
.
log
(
"kakao : "
,
result
.
length
)
return
result
}
module
.
exports
=
{
getData
:
getData
}
...
...
functions/naverFunction.js
View file @
c2be808
...
...
@@ -40,6 +40,7 @@ const makeObject = (array)=>{
const
getData
=
async
()
=>
{
const
browser
=
await
puppeteer
.
launch
();
const
page
=
await
browser
.
newPage
();
page
.
setDefaultNavigationTimeout
(
0
)
await
page
.
goto
(
'https://recruit.navercorp.com/naver/job/list/developer'
)
let
content
=
await
page
.
content
()
...
...
@@ -66,6 +67,7 @@ const getData = async ()=>{
})
resArr
=
result
.
split
(
'</li><li>'
)
result
=
makeObject
(
resArr
)
console
.
log
(
"naver : "
,
result
.
length
)
return
result
;
}
...
...
functions/programmersFunction.js
View file @
c2be808
...
...
@@ -43,7 +43,8 @@ const makeObject = (array)=>{
const
getData
=
async
()
=>
{
const
browser
=
await
puppeteer
.
launch
();
const
page
=
await
browser
.
newPage
();
page
.
setDefaultNavigationTimeout
(
0
)
let
result
=
[]
let
temp
=
""
let
count
=
1
;
...
...
Please
register
or
login
to post a comment