Skip to content

Instantly share code, notes, and snippets.

@Njuelle
Created December 19, 2018 10:29
Show Gist options
  • Select an option

  • Save Njuelle/06695c3ecaf25c90ed77e9d211a9a5e0 to your computer and use it in GitHub Desktop.

Select an option

Save Njuelle/06695c3ecaf25c90ed77e9d211a9a5e0 to your computer and use it in GitHub Desktop.
puppeteer
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