Skip to main content
The Deno 2 Release Candidate is here
Learn more
Go to Latest
method JSHandle.prototype.evaluate
Re-export
import { JSHandle } from "https://deno.land/x/puppeteer@14.1.1/vendor/puppeteer-core/puppeteer/api-docs-entry.d.ts";

This method passes this handle as the first argument to pageFunction. If pageFunction returns a Promise, then handle.evaluate would wait for the promise to resolve and return its value.

Examples

Example 1

const tweetHandle = await page.$('.tweet .retweets');
expect(await tweetHandle.evaluate(node => node.innerText)).toBe('10');

Type Parameters

T extends EvaluateFn<HandleObjectType>

Parameters

pageFunction: T | string