how to ensure the quality of puppeteer batch screenshots
outer for loop task list. Post the code inside
// Chromium
const browser = await puppeteer.launch({ ignoreHTTPSErrors: true, headless: true, args: ["--no-sandbox", "--disable-setuid-sandbox"] }).catch( err => {
console.log("launch-err: " + err)
reject("fail")
})
//
const page = await browser.newPage()
//
await page.setViewport({ width: 1920, height: 1080 })
//
console.log("website-> " + taskInfo[2])
await page.goto(taskInfo[2], { waitUntil: ["domcontentloaded", "load","networkidle0"] }).catch(err => {
console.log("goto-err-> " + err)
reject("fail")
})
await page.waitFor(5000)
try {
//
await page.screenshot({ path: snapShotFolerPath + snapshotName, fullPage: true }).catch(err => {
console.log("screenshot-err-> " + err)
reject("fail")
})
} catch (e) {
reject("fail")
console.log("failed " + e)
}
the problem encountered now is that the screenshot can be successful, but it is found that some screenshots will encounter blank or 404. How can the bosses solve this problem