Skip to content

Instantly share code, notes, and snippets.

@PedroRajao
Created September 10, 2018 14:17
Show Gist options
  • Save PedroRajao/fc61e643d3552fceb1634946bef45eb6 to your computer and use it in GitHub Desktop.
Save PedroRajao/fc61e643d3552fceb1634946bef45eb6 to your computer and use it in GitHub Desktop.
Synchronous Puppeteer Template
const puppeteer = require('puppeteer');
puppeteer.launch().then(browser => {
browser.newPage()
.then(page => {
page.goto('https://www.google.com')
.then(resp => page.screenshot({path: 'example.png'}))
.then(buffer => browser.close());
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment