Toggle navigation
Toggle navigation
This project
Loading...
Sign in
HyeonJun Jeon
/
Extended-Calendar
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
박시진
2022-05-30 05:29:03 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
d1b3ef79d2928a59e4736778a4873c4220cf0b4f
d1b3ef79
1 parent
b8228dc2
[Modify]compile error, express module
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
4 deletions
package-lock.json
package.json
src/libs/E_Campus.js
src/libs/E_Campus_loginTest.js
package-lock.json
View file @
d1b3ef7
...
...
@@ -11,6 +11,7 @@
"@testing-library/jest-dom"
:
"^5.16.4"
,
"@testing-library/react"
:
"^13.2.0"
,
"@testing-library/user-event"
:
"^13.5.0"
,
"express"
:
"^4.18.1"
,
"localforage"
:
"^1.10.0"
,
"puppeteer"
:
"^14.1.1"
,
"react"
:
"^18.1.0"
,
...
...
package.json
View file @
d1b3ef7
...
...
@@ -6,6 +6,7 @@
"@testing-library/jest-dom"
:
"^5.16.4"
,
"@testing-library/react"
:
"^13.2.0"
,
"@testing-library/user-event"
:
"^13.5.0"
,
"express"
:
"^4.18.1"
,
"localforage"
:
"^1.10.0"
,
"puppeteer"
:
"^14.1.1"
,
"react"
:
"^18.1.0"
,
...
...
src/libs/E_Campus.js
View file @
d1b3ef7
const
puppeteer
=
require
(
"puppeteer"
);
function
login
(
id
,
pw
)
{
const
crawler
=
async
()
=>
{
try
{
...
...
@@ -14,6 +15,7 @@ function login(id, pw) {
document
.
querySelector
(
"#login_user_password"
).
value
=
pw
document
.
querySelector
(
'#form1 > div > div.login_btn > a > span'
).
click
();
})
await
page
.
waitForTimeout
(
500
);
}
catch
(
err
){
console
.
log
(
err
)
...
...
@@ -28,5 +30,3 @@ function login(id, pw) {
}
export
{
login
};
...
...
src/libs/E_Campus_loginTest.js
View file @
d1b3ef7
...
...
@@ -3,6 +3,7 @@ const puppeteer = require("puppeteer");
const
crawler
=
async
()
=>
{
try
{
const
browser
=
await
puppeteer
.
launch
({
headless
:
false
,
args
:[
'--window-size=1920,1080'
]});
// for observing the process of login, headless -> false
const
page
=
await
browser
.
newPage
();
await
page
.
setViewport
({
width
:
1920
,
...
...
@@ -10,8 +11,8 @@ const crawler = async() => {
})
await
page
.
goto
(
'https://e-campus.khu.ac.kr/xn-sso/login.php?auto_login=&sso_only=&cvs_lgn=&return_url=https%3A%2F%2Fe-campus.khu.ac.kr%2Fxn-sso%2Fgw-cb.php%3Ffrom%3D%26login_type%3Dstandalone%26return_url%3Dhttps%253A%252F%252Fe-campus.khu.ac.kr%252Flogin%252Fcallback'
);
await
page
.
evaluate
(()
=>
{
document
.
querySelector
(
"#login_user_id"
).
value
=
//자
기
account id
document
.
querySelector
(
"#login_user_password"
).
value
=
//
자기
pw
document
.
querySelector
(
"#login_user_id"
).
value
=
//자
신의 E_Campus
account id
document
.
querySelector
(
"#login_user_password"
).
value
=
// pw
document
.
querySelector
(
'#form1 > div > div.login_btn > a > span'
).
click
();
})
...
...
Please
register
or
login
to post a comment