Fix Puppeter deprecation warnings

This commit is contained in:
ngosang 2022-01-30 23:23:06 +01:00
parent 0cbca1fb79
commit 0a438358d1
2 changed files with 3 additions and 3 deletions

View File

@ -69,7 +69,7 @@ export default async function resolveChallenge(url: string, page: Page, response
// wait until redirecting disappears
while (true) {
try {
await page.waitFor(1000)
await page.waitForTimeout(1000)
const displayStyle2 = await page.evaluate(() => {
return getComputedStyle(document.querySelector('#cf-spinner-redirecting')).getPropertyValue("display");
});
@ -96,7 +96,7 @@ export default async function resolveChallenge(url: string, page: Page, response
}
log.debug('Waiting for Cloudflare challenge...')
await page.waitFor(1000)
await page.waitForTimeout(1000)
}
log.debug('Validating HTML code...')

View File

@ -177,7 +177,7 @@ async function gotoPage(params: V1Request, page: Page): Promise<HTTPResponse> {
</html>
`
);
await page.waitFor(2000)
await page.waitForTimeout(2000)
try {
await page.waitForNavigation({waitUntil: 'domcontentloaded', timeout: 2000})
} catch (e) {}