import { ElementHandle } from "https://deno.land/x/frugal@0.9.6/dep/puppeteer/mod.ts";
ElementHandle represents an in-page DOM element.
Constructors
Methods
Queries the current element for an element matching the given selector.
Queries the current element for all elements matching the given selector.
Runs the given function on an array of elements matching the given selector in the current element.
If the given function returns a promise, then this method will wait till the promise resolves.
Runs the given function on the first element matching the given selector in the current element.
If the given function returns a promise, then this method will wait till the promise resolves.
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.
Returns the middle point within an element unless a specific offset is provided.
Resolves to the content frame for element handles referencing iframe nodes, or null otherwise
This method creates and captures a dragevent from the element.
This method triggers a dragenter, dragover, and drop on the element.
This method creates a dragenter
event on the element.
This method creates a dragover
event on the element.
This method triggers a drop on the element.
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.
Wait for an element matching the given selector to appear in the current element.
Unlike Frame.waitForSelector, this method does not work across navigations or if the element is detached from DOM.