Created
September 15, 2022 06:38
-
-
Save w3collective/5155e981cb6672150184183461347e64 to your computer and use it in GitHub Desktop.
Capture website screenshots using Node.js and 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"); | |
const capture = async () => { | |
const browser = await puppeteer.launch(); | |
const page = await browser.newPage(); | |
await page.setViewport({ width: 1024, height: 768 }); | |
await page.goto("https://www.wikipedia.org/"); | |
await page.screenshot({ path: "./screenshot.png" }); | |
await browser.close(); | |
}; | |
capture(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Source => https://w3collective.com/capture-screenshots-node-puppeteer/