Navigation
goto
Navigate the page to a URL.Options include:
- waitUntil: ‘load’ | ‘domcontentloaded’ | ‘networkidle’
- timeoutMs: Maximum navigation time in milliseconds
URL to navigate to.
Return value
reload
Reload the current page.Options include:
- waitUntil: ‘load’ | ‘domcontentloaded’ | ‘networkidle’
- timeoutMs: Maximum reload time in milliseconds
- ignoreCache: Whether to bypass the browser cache
Return value
goBack
Navigate to the previous page in history.Returns null if there is no previous page.
Return value
goForward
Navigate to the next page in history.Returns null if there is no next page.
Return value
waitForLoadState
Wait for the page to reach a specific load state.States:
- ‘load’: Wait for the load event
- ‘domcontentloaded’: Wait for DOMContentLoaded event
- ‘networkidle’: Wait until no network connections for 500ms
Load state to wait for.
Page Info
url
Get the current URL of the page.This is a synchronous method that returns the current URL.
Return value
title
Get the title of the page. Upstream docsReturn value
Actions
click
Click at the specified coordinates.Options include:
- button: ‘left’ | ‘right’ | ‘middle’ (default: ‘left’)
- clickCount: Number of clicks (default: 1, use 2 for double-click)
- returnXpath: If true, returns the XPath of the clicked element
X coordinate to click.
Y coordinate to click.
Return value
hover
Hover at the specified coordinates.If returnXpath is true, returns the XPath of the hovered element.
X coordinate to hover over.
Y coordinate to hover over.
Return value
scroll
Scroll at the specified position by the given delta.Positive deltaY scrolls down, negative scrolls up.
X coordinate of scroll origin.
Y coordinate of scroll origin.
Horizontal scroll amount in pixels.
Vertical scroll amount in pixels.
dragAndDrop
Drag from one point to another.If returnXpath is true, returns [fromXpath, toXpath] of the dragged elements.
Starting X coordinate.
Starting Y coordinate.
Ending X coordinate.
Ending Y coordinate.
Return value
type
Type text into the currently focused element.The delay option adds a pause between keystrokes for realistic typing.
Text to type.
Queries
locator
Create a locator for an element using a CSS or XPath selector.Locators support automatic shadow DOM traversal.
CSS or XPath selector.
Return value
deepLocator
Create a deep locator that can traverse iframes and shadow roots.Deep locators use hop notation to navigate through iframes:
- Use >>> to hop into an iframe
- Example: “#outer-frame >>> #inner-frame >>> button”
Selector with optional hop notation for iframes.
Return value
Waiting
waitForSelector
Wait for an element matching the selector to appear.Options include:
- state: ‘visible’ | ‘hidden’ | ‘attached’ | ‘detached’
- timeout: Maximum wait time in milliseconds
- pierceShadow: Whether to pierce shadow DOM (default: true)
Selector to wait for.
Screenshots & PDF
screenshot
Capture a screenshot of the page.Options include:
- path: File path to save the screenshot
- fullPage: Capture the full scrollable page
- type: ‘png’ | ‘jpeg’
- quality: JPEG quality (0-100)
- clip: Specific region to capture
Return value
snapshot
Get a snapshot of the page DOM.Returns a structured representation of the page content.
Return value
Evaluation
evaluate
Execute JavaScript code within the page context.The return value must be JSON-serializable.
Function or expression to evaluate in the page context.
Argument to pass to the function.
Return value
Other
addInitScript
Add an initialization script that runs before page scripts.The script runs on every navigation.
The script to inject.
Argument to pass to the function.
setViewportSize
Set the viewport size of the page. Upstream docsViewport width in pixels.
Viewport height in pixels.
Additional viewport options.

