const path = require('path'); const puppeteer = require('puppeteer-core'); async function main() { const browser = await puppeteer.launch({ executablePath: 'google-chrome-stable', args: ['--no-sandbox'], }) const page = await browser.newPage(); await page.setViewport({ width: 600, height: 800 }); await page.goto(`http://localhost:8080`, { waitUntil: 'networkidle0' }); await page.waitFor(2000); await page.screenshot({path: 'screenshot/color.png'}); await browser.close(); } main().then(console.log).catch(console.error)