This repository has been archived by the owner on May 10, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
lohn.js
executable file
·48 lines (43 loc) · 1.58 KB
/
lohn.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/usr/bin/env nodejs
const puppeteer = require('puppeteer');
const readlineSync = require('readline-sync');
function getSmsCode(){
var sms = readlineSync.question('Enter your Smscode: ');
return sms;
}
function delay(time) {
return new Promise(function(resolve) {
setTimeout(resolve, time)
});
}
async function run() {
const browser = await puppeteer.launch({
headless: true,
ignoreHTTPSErrors: true
})
const page = await browser.newPage()
const CREDS = require('./cred');
await page.setViewport({ width: 1920, height: 1024 });
await page.goto('https://www.datev.de/ano/');
await page.click('#loginContainer > div > ul > li:nth-child(1) > a > div > div.media-body');
await page.waitForSelector('#username')
await page.click('#username');
await page.keyboard.type(CREDS.username);
await page.click('#password');
await page.keyboard.type(CREDS.password);
await page.click('body > main > form > button');
await page.waitForNavigation();
await page.click(' #mTAN');
await page.keyboard.type(getSmsCode());
await page.click('body > main > form > button');
await delay(5000);
await page.waitForSelector('#navSTARTHEADLINEDOCS > a');
await page.click('#navSTARTHEADLINEDOCS > a');
await page.waitForSelector('.analysisGrid table > tbody > tr > td:nth-child(2) > div.analysisCaption');
await page.click('.analysisGrid table > tbody > tr > td:nth-child(1) > input[type="checkbox"]');
await page.click("#btnDownloadZip");
await delay(2000);
await page.click('#top > div.infobar > ul > li:nth-child(2) > a');
await browser.close();
}
run();