Created
December 19, 2018 10:29
-
-
Save Njuelle/06695c3ecaf25c90ed77e9d211a9a5e0 to your computer and use it in GitHub Desktop.
puppeteer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const | |
| puppeteer = require('puppeteer'), | |
| path = require('path'); | |
| const runInBrowser = async () => { | |
| const | |
| browser = await puppeteer.launch(), | |
| page = await browser.newPage(); | |
| page.on('console', msg => { | |
| console.log(msg._text); | |
| }); | |
| await page.goto(`file:${path.join(__dirname, 'test.html')}`); | |
| await browser.close() | |
| } | |
| runInBrowser(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment