summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoreug-vs <eug-vs@keemail.me>2020-11-10 23:46:39 +0300
committereug-vs <eug-vs@keemail.me>2020-11-10 23:47:10 +0300
commit4ac357c935fdcf07ad46301572a703f2fece56d7 (patch)
tree519a653cf8c8fea4a2ebc849b4bff0ea9e682aef /src
parent4a1a10c53a3ea08f395fcbee447d4babcb86f792 (diff)
downloadbsu-fantom-4ac357c935fdcf07ad46301572a703f2fece56d7.tar.gz
chore: install dotenv
Diffstat (limited to 'src')
-rw-r--r--src/index.js14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/index.js b/src/index.js
index a318ccd..507085a 100644
--- a/src/index.js
+++ b/src/index.js
@@ -1,5 +1,12 @@
+require('dotenv').config();
const puppeteer = require('puppeteer');
+
+const clickElementByXPath = (page, xPath) => page
+ .waitForXPath(xPath)
+ .then(item => item.click());
+
+
const {
EDUFPMI_URL,
EDUFPMI_USERNAME,
@@ -7,12 +14,6 @@ const {
COURSE_URL
} = process.env;
-
-const clickElementByXPath = (page, xPath) => page
- .waitForXPath(xPath)
- .then(item => item.click());
-
-
puppeteer.launch({ headless: true })
.then(async browser => {
const page = await browser.newPage();
@@ -27,7 +28,6 @@ puppeteer.launch({ headless: true })
// Launch a meeting
await page.goto(COURSE_URL, { waitUntil: 'networkidle0' });
- await page.screenshot({ path: './screenshot1.png' });
const moodlePagePromise = new Promise(resolve => browser.on(
'targetcreated',
target => resolve(target.page())