Puppeteer wait for the page to load and then take a screenshot. This is the demo.

const puppeteer = require("puppeteer");
const path = require("path");

(async () => {
  const browser = await puppeteer.launch();
  const page = await browser.newPage();
  await page.goto("xxxxxxxx");
  await page.screenshot({path: path.join(__dirname,"example.png"),fullPage: true, omitBackground: true });

  await browser.close();
})();
The

page is written in react, and there is a Loading page, and each screenshot is loading, not after loading.

Sep.16,2021

waitForNavigation

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e9c66a-18cd.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e9c66a-18cd.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?