Toggle navigation
Toggle navigation
This project
Loading...
Sign in
신원형
/
study-or-enjoy
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
신원형
2022-05-27 03:28:43 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
547a0afa9abe2491ecea4a00b3d1fad16d3a598c
547a0afa
1 parent
58c4e9c1
implemented weather forecast
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
22 additions
and
16 deletions
.vscode/launch.json
khcanvas.js
main.js
package-lock.json
package.json
.vscode/launch.json
View file @
547a0af
...
...
@@ -5,6 +5,23 @@
"version"
:
"0.2.0"
,
"configurations"
:
[
{
"type"
:
"node"
,
"request"
:
"launch"
,
"name"
:
"Mocha All"
,
"program"
:
"${workspaceFolder}/node_modules/mocha/bin/_mocha"
,
"args"
:
[
"--timeout"
,
"999999"
,
"--colors"
,
"${workspaceFolder}/test"
],
"console"
:
"integratedTerminal"
,
"internalConsoleOptions"
:
"neverOpen"
,
"skipFiles"
:
[
"<node_internals>/**/*.js"
]
},
{
"type"
:
"pwa-node"
,
"request"
:
"launch"
,
"name"
:
"Launch Program"
,
...
...
khcanvas.js
View file @
547a0af
...
...
@@ -87,7 +87,7 @@ export async function load(driver, until) {
export
async
function
logout
(
driver
)
{
await
driver
.
get
(
"https://khcanvas.khu.ac.kr/"
)
const
logoutPanel
=
await
driver
.
findElement
(
selenium
.
By
.
xpath
(
'html/body/div[2]/header[2]/div[1]/ul/li[1]/button/div[1]'
)).
click
();
await
driver
.
findElement
(
selenium
.
By
.
xpath
(
'html/body/div[2]/header[2]/div[1]/ul/li[1]/button/div[1]'
)).
click
();
await
sleep
(
1000
)
const
logout
=
await
driver
.
findElement
(
selenium
.
By
.
xpath
(
'html/body/div[3]/span/span/div/div/div/div/div/span/form/button'
));
logout
.
click
()
...
...
main.js
View file @
547a0af
import
fs
from
'fs/promises'
import
{
login
,
load
,
logout
}
from
'./khcanvas.js'
;
fs
.
readFile
(
"asdffdsa.txt"
).
then
(
it
=>
{
const
auth
=
it
.
toString
().
split
(
'|'
)
login
(
auth
[
0
],
auth
[
1
]).
then
(
async
driver
=>
{
load
(
driver
,
new
Date
())
.
then
(
it
=>
{
console
.
log
(
it
)
logout
(
driver
)
})
}).
catch
(
err
=>
{
console
.
log
(
err
)
})
})
\ No newline at end of file
package-lock.json
View file @
547a0af
This diff is collapsed. Click to expand it.
package.json
View file @
547a0af
...
...
@@ -13,13 +13,15 @@
"author"
:
""
,
"license"
:
""
,
"dependencies"
:
{
"@types/axios"
:
"^0.14.0"
,
"@types/selenium-webdriver"
:
"^4.1.0"
,
"
eslint"
:
"^8.15.0
"
,
"
axios"
:
"^0.27.2
"
,
"mocha"
:
"^10.0.0"
,
"selenium-webdriver"
:
"^4.1.2"
},
"type"
:
"module"
,
"devDependencies"
:
{
"@types/node"
:
"^17.0.35"
"@types/node"
:
"^17.0.35"
,
"eslint"
:
"^8.16.0"
}
}
...
...
Please
register
or
login
to post a comment