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

x/pptr/mod.ts>Frame#$$eval

Headless Chrome Deno API
Latest
method Frame.prototype.$$eval
Re-export
import { Frame } from "https://deno.land/x/pptr@1.2.0/mod.ts";

Examples

Example 1

const divsCounts = await frame.$$eval('div', divs => divs.length);

Type Parameters

ReturnType

Parameters

selector: string
  • the selector to query for
pageFunction: (elements: Element[], ...args: unknown[]) => ReturnType | Promise<ReturnType>
  • the function to be evaluated in the frame's context
  • additional arguments to pass to pageFuncton