import { ElementHandle } from "https://deno.land/x/pptr@1.2.0/mod.ts";
ElementHandle represents an in-page DOM element.
Constructors
Properties
Methods
Runs element.querySelector
within the page. If no element matches the selector,
the return value resolves to null
.
Runs element.querySelectorAll
within the page. If no elements match the selector,
the return value resolves to []
.
This method runs document.querySelectorAll
within the element and passes it as
the first argument to pageFunction
. If there's no element matching selector
,
the method throws an error.
If pageFunction
returns a Promise, then frame.$$eval
would wait for the
promise to resolve and return its value.
This method runs document.querySelector
within the element and passes it as
the first argument to pageFunction
. If there's no element matching selector
,
the method throws an error.
If pageFunction
returns a Promise, then frame.$eval
would wait for the promise
to resolve and return its value.
The method evaluates the XPath expression relative to the elementHandle. If there are no such elements, the method will resolve to an empty array.
This method returns the bounding box of the element (relative to the main frame),
or null
if the element is not visible.
This method returns boxes of the element, or null
if the element is not visible.
This method scrolls element into view if needed, and then uses Page.mouse to click in the center of the element. If the element is detached from DOM, the method throws an error.
Resolves to the content frame for element handles referencing iframe nodes, or null otherwise
This method scrolls element into view if needed, and then uses Page.mouse to hover over the center of the element. If the element is detached from DOM, the method throws an error.
Resolves to true if the element is visible in the current viewport.
Focuses the element, and then uses Keyboard.down and Keyboard.up.
This method scrolls element into view if needed, and then uses Page.screenshot to take a screenshot of the element. If the element is detached from DOM, the method throws an error.
Triggers a change
and input
event once all the provided options have been
selected. If there's no <select>
element matching selector
, the method
throws an error.
This method scrolls element into view if needed, and then uses Touchscreen.tap to tap in the center of the element. If the element is detached from DOM, the method throws an error.
Focuses the element, and then sends a keydown
, keypress
/input
, and
keyup
event for each character in the text.
To press a special key, like Control
or ArrowDown
,
use ElementHandle.press.
This method expects elementHandle
to point to an
input element.