Example:
await page.evaluate(() => {
$.ajax()...
});
Then, I will get all elements on the page to continue to crawl.
you can use evaluate callback as an async function, like this:
await page.evaluate(async () => {
const result = await $.ajax({
});
// do something with result here
});
the outer await
on page.evaluate
will then wait for the ajax to finish before continuing