$ docker run -it --rm -v "$PWD":/app/ buildkite/puppeteer:latest node /app/app.js
Saved example.png
-
-
Save toolmantim/6d5be00f2164cf9ec1d0d8aa592bb063 to your computer and use it in GitHub Desktop.
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({ | |
args: [ | |
'--no-sandbox', | |
'--disable-setuid-sandbox', | |
'--disable-dev-shm-usage' | |
] | |
}); | |
const page = await browser.newPage(); | |
await page.goto('https://example.com'); | |
await page.screenshot({path: '/app/example.png'}); | |
console.log("Saved example.png") | |
await browser.close(); | |
})() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment