summaryrefslogtreecommitdiff
path: root/src/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/index.js')
-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())