Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/pptr/mod.ts>JSHandle#evaluate

Headless Chrome Deno API
Latest
method JSHandle.prototype.evaluate
Re-export
import { JSHandle } from "https://deno.land/x/pptr@1.2.0/mod.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');

Parameters

pageFunction: T | string