In Puppeteer you can evaluate async functions:
await page.evaluate(async () => {
// await some promise
});
Is there an equivalent in PuppeteerSharp? Using EvaluateFunctionAsync
, the task completes before the promise resolves:
await page.EvaluateFunctionAsync(@"async () => {
// await some promise
}");