wait until body is fetched

This commit is contained in:
Hongbo Wu 2024-07-10 16:01:39 +08:00
parent 431c4cc098
commit e61da03ed4

View file

@ -336,8 +336,6 @@ async function retrievePage(
throw new Error('No response from page')
}
await page.waitForSelector('body')
const finalUrl = response.url()
const contentType = response.headers()['content-type']
@ -364,6 +362,8 @@ async function retrieveHtml(page: Page, logRecord: Record<string, any>) {
title = await page.title()
logRecord.title = title
await page.waitForSelector('body')
const pageScrollingStart = Date.now()
/* scroll with a 5 seconds timeout */
try {