Toggle navigation
Toggle navigation
This project
Loading...
Sign in
최재은
/
밀당강의봇
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
최재은
2019-05-26 13:13:31 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
4ee4b907186eff8819294ca59a969c11446c51a5
4ee4b907
1 parent
38292bee
Login crawling test success using puppeteer
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
0 deletions
crawling_test.js
package-lock.json
package.json
crawling_test.js
0 → 100644
View file @
4ee4b90
const
puppeteer
=
require
(
'puppeteer'
);
(
async
()
=>
{
const
browser
=
await
puppeteer
.
launch
();
const
page
=
await
browser
.
newPage
();
const
et_id
=
""
;
const
et_pw
=
""
;
const
lecture
=
"오픈소스SW개발"
;
await
page
.
goto
(
'https://everytime.kr/login'
);
await
page
.
evaluate
((
id
,
pw
)
=>
{
document
.
querySelector
(
"input[name=userid]"
).
value
=
id
;
document
.
querySelector
(
"input[name=password]"
).
value
=
pw
;
},
et_id
,
et_pw
);
await
console
.
log
(
"로그인 정보 삽입 완료"
)
await
page
.
click
(
'#container > form > p.submit > input'
);
await
page
.
waitFor
(
1000
);
await
page
.
goto
(
'https://everytime.kr/lecture'
);
await
page
.
screenshot
({
path
:
'AfterLogin.png'
,
fullPage
:
true
});
await
page
.
evaluate
((
lec
)
=>
{
document
.
querySelector
(
"input[name=keyword]"
).
value
=
lec
;
},
lecture
);
await
page
.
click
(
'#container > form > input.submit'
);
await
page
.
waitFor
(
1000
);
await
page
.
click
(
'#container > div > a'
)
await
page
.
waitFor
(
1000
);
await
page
.
screenshot
({
path
:
'result.png'
,
fullPage
:
true
});
await
browser
.
close
();
})();
\ No newline at end of file
package-lock.json
View file @
4ee4b90
This diff is collapsed. Click to expand it.
package.json
View file @
4ee4b90
...
...
@@ -14,6 +14,8 @@
"dotenv"
:
"^8.0.0"
,
"express"
:
"^4.17.0"
,
"mongoose"
:
"^5.5.11"
,
"puppeteer"
:
"^1.17.0"
,
"puppeteer-core"
:
"^1.17.0"
,
"request"
:
"^2.88.0"
}
}
...
...
Please
register
or
login
to post a comment