import { Page } from "https://deno.land/x/frugal@0.9.6/dep/puppeteer/mod.ts";
Examples
Example 1
Example 1
const firstResponse = await page.waitForResponse(
'https://example.com/resource'
);
const finalResponse = await page.waitForResponse(
response =>
response.url() === 'https://example.com' && response.status() === 200
);
const finalResponse = await page.waitForResponse(async response => {
return (await response.text()).includes('<html>');
});
return finalResponse.ok();
Parameters
urlOrPredicate: string | ((req: HTTPRequest) => boolean | Promise<boolean>)
- A URL or predicate to wait for
Returns
Promise<HTTPRequest>
Promise which resolves to the matched response