Skip to content

Instantly share code, notes, and snippets.

@almond-bongbong
Created September 4, 2018 14:20
Show Gist options
  • Save almond-bongbong/7fc5d3f704602133c9899a0c25770492 to your computer and use it in GitHub Desktop.
Save almond-bongbong/7fc5d3f704602133c9899a0c25770492 to your computer and use it in GitHub Desktop.
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.goto('https://news.ycombinator.com', {waitUntil: 'networkidle2'});
await page.pdf({path: './pdf/hn.pdf', format: 'A4'});
await browser.close();
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment