Created
April 29, 2020 12:04
-
-
Save Juddling/fdad2b9034030d9e141dc818a1842890 to your computer and use it in GitHub Desktop.
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-core'); | |
| (async () => { | |
| // connect to the dockerised chrome | |
| const browser = await puppeteer.connect({ | |
| browserURL: 'http://docker.for.mac.localhost:9222' | |
| }); | |
| const page = await browser.newPage(); | |
| await page.goto('https://github.com/puppeteer/puppeteer', { waitUntil: 'networkidle2' }); | |
| await page.screenshot({ path: 'screenshots/example.png' }); | |
| await browser.close(); | |
| })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment