Last active
February 23, 2022 02:38
-
-
Save pirate/983322a361416dc630752476ef435b1c to your computer and use it in GitHub Desktop.
Requested behavior for --full-page CLI option for chrome --headless --screenshot.
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.setViewport({width: 1440, height: 1200}); | |
await page.goto('https://example.com', {waitUntil: 'networkidle2'}); | |
await page.screenshot({path: 'screenshot.png', fullPage: true}); | |
await browser.close(); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment