The method runs element.querySelector within the page. If no element matches the selector, the return value resolve to null.
A selector to query element for
The method runs element.querySelectorAll within the page. If no elements match the selector, the return value resolve to [].
A selector to query element for
Not available: use a selector with the xpath/ prefix instead, e.g. handle.$$("xpath/.//a").
XPath expression to evaluate.
Returns a ElementHandle
This method returns the value resolve to 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. Boxes are represented as an array of points; each Point is an object {x, y}. Box points are sorted clock-wise.
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.
Optionaloptions: ClickOptions
Specifies the options.
Stops referencing the element handle.
Not available.
Gets the execution context.
Calls focus 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.
Name of key to press, such as ArrowLeft. See USKeyboardLayout for a list of all key names.
Optionaloptions: { delay?: number; text?: string }
The text and delay options.
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.
Optionaloptions: Base64ScreenShotOptions
Same options as in page.screenshot.
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.
Returns a string representation of an object.
Focuses the element, and then sends a keydown, keypress/input, and keyup event for each character in the text.
A text to type into a focused element.
Optionaloptions: { delay: number }
The typing options.
Not available: pjsc never reads server files into the page.
This method expects elementHandle to point to an input element.
Sets the value of the file input these paths. If some of the filePaths are relative paths, then they are resolved relative to current working directory.
Represents an in-page DOM element.
The element handles pjsc returns (from
page.$,page.$$,frame.$and the handle members) are documented at ElementHandle; members marked "Not available" below are not provided.