Skip to content

Instantly share code, notes, and snippets.

@Juddling
Created April 29, 2020 12:04
Show Gist options
  • Select an option

  • Save Juddling/fdad2b9034030d9e141dc818a1842890 to your computer and use it in GitHub Desktop.

Select an option

Save Juddling/fdad2b9034030d9e141dc818a1842890 to your computer and use it in GitHub Desktop.
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