Skip to content

Instantly share code, notes, and snippets.

View sibbng's full-sized avatar

sibbng

View GitHub Profile
@shospodarets
shospodarets / Chrome headless Puppeteer- capture DOM element screenshot using
Last active July 29, 2024 05:58
Chrome headless Puppeteer- capture DOM element screenshot using
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch();
const page = await browser.newPage();
// Adjustments particular to this page to ensure we hit desktop breakpoint.
page.setViewport({width: 1000, height: 600, deviceScaleFactor: 1});
await page.goto('https://www.chromestatus.com/samples', {waitUntil: 'networkidle'});