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

x/pptr/mod.ts>JSHandle#getProperties

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

The method returns a map with property names as keys and JSHandle instances for the property values.

Examples

Example 1

const listHandle = await page.evaluateHandle(() => document.body.children);
const properties = await listHandle.getProperties();
const children = [];
for (const property of properties.values()) {
  const element = property.asElement();
  if (element)
    children.push(element);
}
children; // holds elementHandles to all children of document.body

Returns

Promise<Map<string, JSHandle>>