신원형

implemented weather forecast

...@@ -5,6 +5,23 @@ ...@@ -5,6 +5,23 @@
5 "version": "0.2.0", 5 "version": "0.2.0",
6 "configurations": [ 6 "configurations": [
7 { 7 {
8 + "type": "node",
9 + "request": "launch",
10 + "name": "Mocha All",
11 + "program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
12 + "args": [
13 + "--timeout",
14 + "999999",
15 + "--colors",
16 + "${workspaceFolder}/test"
17 + ],
18 + "console": "integratedTerminal",
19 + "internalConsoleOptions": "neverOpen",
20 + "skipFiles": [
21 + "<node_internals>/**/*.js"
22 + ]
23 + },
24 + {
8 "type": "pwa-node", 25 "type": "pwa-node",
9 "request": "launch", 26 "request": "launch",
10 "name": "Launch Program", 27 "name": "Launch Program",
......
...@@ -87,7 +87,7 @@ export async function load(driver, until) { ...@@ -87,7 +87,7 @@ export async function load(driver, until) {
87 export async function logout(driver) { 87 export async function logout(driver) {
88 await driver.get("https://khcanvas.khu.ac.kr/") 88 await driver.get("https://khcanvas.khu.ac.kr/")
89 89
90 - const logoutPanel = await driver.findElement(selenium.By.xpath('html/body/div[2]/header[2]/div[1]/ul/li[1]/button/div[1]')).click(); 90 + await driver.findElement(selenium.By.xpath('html/body/div[2]/header[2]/div[1]/ul/li[1]/button/div[1]')).click();
91 await sleep(1000) 91 await sleep(1000)
92 const logout = await driver.findElement(selenium.By.xpath('html/body/div[3]/span/span/div/div/div/div/div/span/form/button')); 92 const logout = await driver.findElement(selenium.By.xpath('html/body/div[3]/span/span/div/div/div/div/div/span/form/button'));
93 logout.click() 93 logout.click()
......
1 -import fs from 'fs/promises'
2 -import { login, load, logout } from './khcanvas.js';
3 -
4 -fs.readFile("asdffdsa.txt").then(it => {
5 - const auth = it.toString().split('|')
6 - login(auth[0], auth[1]).then(async driver => {
7 - load(driver, new Date())
8 - .then(it => {
9 - console.log(it)
10 - logout(driver)
11 - })
12 - }).catch(err => { console.log(err) })
13 -})
...\ No newline at end of file ...\ No newline at end of file
This diff is collapsed. Click to expand it.
...@@ -13,13 +13,15 @@ ...@@ -13,13 +13,15 @@
13 "author": "", 13 "author": "",
14 "license": "", 14 "license": "",
15 "dependencies": { 15 "dependencies": {
16 + "@types/axios": "^0.14.0",
16 "@types/selenium-webdriver": "^4.1.0", 17 "@types/selenium-webdriver": "^4.1.0",
17 - "eslint": "^8.15.0", 18 + "axios": "^0.27.2",
18 "mocha": "^10.0.0", 19 "mocha": "^10.0.0",
19 "selenium-webdriver": "^4.1.2" 20 "selenium-webdriver": "^4.1.2"
20 }, 21 },
21 "type": "module", 22 "type": "module",
22 "devDependencies": { 23 "devDependencies": {
23 - "@types/node": "^17.0.35" 24 + "@types/node": "^17.0.35",
25 + "eslint": "^8.16.0"
24 } 26 }
25 } 27 }
......