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

Menu