diff options
author | eug-vs <eug-vs@keemail.me> | 2020-11-10 23:46:39 +0300 |
---|---|---|
committer | eug-vs <eug-vs@keemail.me> | 2020-11-10 23:47:10 +0300 |
commit | 4ac357c935fdcf07ad46301572a703f2fece56d7 (patch) | |
tree | 519a653cf8c8fea4a2ebc849b4bff0ea9e682aef /src | |
parent | 4a1a10c53a3ea08f395fcbee447d4babcb86f792 (diff) | |
download | bsu-fantom-4ac357c935fdcf07ad46301572a703f2fece56d7.tar.gz |
chore: install dotenv
Diffstat (limited to 'src')
-rw-r--r-- | src/index.js | 14 |
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()) |