From 4ac357c935fdcf07ad46301572a703f2fece56d7 Mon Sep 17 00:00:00 2001 From: eug-vs Date: Tue, 10 Nov 2020 23:46:39 +0300 Subject: chore: install dotenv --- src/index.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src') 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()) -- cgit v1.2.3