import { JSHandle } from "https://deno.land/x/pptr@1.2.0/src/JSHandle.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
Example 1
const tweetHandle = await page.$('.tweet .retweets');
expect(await tweetHandle.evaluate(node => node.innerText)).toBe('10');
Type Parameters
T extends EvaluateFn
Parameters
pageFunction: T | string
...args: SerializableOrJSHandle[]
Returns
Promise<UnwrapPromiseLike<EvaluateFnReturnType<T>>>