Created
January 30, 2018 21:06
-
-
Save gngeorgiev/f3b8777759813558f168bfe6cd34a79c to your computer and use it in GitHub Desktop.
pdf
This file contains 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'); | |
(async () => { | |
const browser = await puppeteer.launch(); | |
const page = await browser.newPage(); | |
await page.goto('https://news.ycombinator.com', {waitUntil: 'networkidle2'}); | |
await page.pdf({path: '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