Last active
May 12, 2022 20:45
-
-
Save gerrard00/e01426b071f4b74af7662e5e656bbba6 to your computer and use it in GitHub Desktop.
Convert web site, html, eml or whatever chrome can open to png using puppeteer
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 (url) => { | |
const browser = await puppeteer.launch(); | |
const page = await browser.newPage(); | |
await page.goto(url); | |
await page.screenshot({ path: "screenshot.png", fullPage: true }); | |
await browser.close(); | |
})('http://foo.com'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment