Puppeteer Page
All Page methods available when using the Puppeteer driver.
Access via runtime.page after launching a Puppeteer runtime.
How these methods work over HTTP
Every method below is a remote call. The SDK translates it into a structured step sent to a single endpoint:
The call field maps directly to the method name. args is a JSON array of the method’s arguments. You can batch multiple steps in one request.
Navigation
goto(url, options?)
Navigate to a URL.
Returns PuppeteerHTTPResponse \| null
— The main resource response, or null if navigating to about:blank.
reload(options?)
Reload the page.
Returns PuppeteerHTTPResponse \| null
goBack(options?)
Navigate back in history.
Returns PuppeteerHTTPResponse \| null
goForward(options?)
Navigate forward in history.
Returns PuppeteerHTTPResponse \| null
waitForNavigation(options?)
Wait for navigation to complete.
Returns PuppeteerHTTPResponse \| null
Page Info
title()
Get the page title.
Returns string
url()
Get the current URL.
Returns string
content()
Get the full HTML content.
Returns string
setContent(html, options?)
Set the page content.
setViewport(viewport)
Set the viewport size. Pass null to reset to default.
viewport()
Get the current viewport.
Returns PuppeteerViewport \| null
Actions
click(selector, options?)
Click on an element matching the selector.
type(selector, text, options?)
Type text into an element.
focus(selector)
Focus on an element.
hover(selector)
Hover over an element.
select(selector, …values)
Select options in a <select> element.
Returns string[]
tap(selector)
Tap on an element (for touch devices).
Queries
$(selector)
Query for a single element.
Returns RemotePuppeteerElementHandle \| null
$$(selector)
Query for all matching elements.
Returns RemotePuppeteerElementHandle[]
$x(expression)
Evaluate XPath expression.
Returns RemotePuppeteerElementHandle[]
locator(selector)
Create a locator for the given selector.
Returns RemotePuppeteerLocator
Content
textContent(selector)
Get the text content of an element matching the selector.
Returns string \| null
innerHTML(selector)
Get the inner HTML of an element matching the selector.
Returns string
State Checks
isJavaScriptEnabled()
Check if JavaScript is enabled.
Returns boolean
isDragInterceptionEnabled()
Check if drag interception is enabled.
Returns boolean
isServiceWorkerBypassed()
Check if service worker bypass is enabled.
Returns boolean
Waiting
waitForSelector(selector, options?)
Wait for a selector to appear in the DOM.
Returns RemotePuppeteerElementHandle \| null
waitForTimeout(milliseconds)
Wait for a timeout.
Deprecated: Use await new Promise(r => setTimeout(r, ms)) instead.
waitForFunction(pageFunction, options?, …args)
Wait for a function to return true.
waitForNetworkIdle(options?)
Wait for network to be idle.
waitForFrame(urlOrPredicate, options?)
Wait for a frame to appear.
Note: Predicate functions are not supported in RPC mode. Use URL string instead.
Returns RemotePuppeteerFrame
waitForFileChooser(options?)
Wait for a file chooser to appear.
Returns RemotePuppeteerFileChooser
waitForRequest(urlOrPredicate, options?)
Wait for a specific request.
Note: Predicate functions are not supported in RPC mode. Use URL string instead.
Returns PuppeteerHTTPRequest
waitForResponse(urlOrPredicate, options?)
Wait for a specific response.
Note: Predicate functions are not supported in RPC mode. Use URL string instead.
Returns PuppeteerHTTPResponse
waitForDevicePrompt(options?)
Wait for a device prompt (e.g., Bluetooth, USB).
Returns { devices: Array<{ name: string; id: string }>; select: (deviceId: string) => Promise<void>; cancel: () => Promise<void> }
Screenshots & PDF
screenshot(options?)
Take a screenshot (returns base64 string or Buffer).
Returns string \| Buffer
pdf(options?)
Generate a PDF (returns base64 string or Buffer).
Returns string \| Buffer
Evaluation
evaluate(pageFunction, …args)
Evaluate JavaScript in the page context.
Returns T
$eval(selector, pageFunction, …args)
Evaluate JavaScript on a selected element.
Returns T
$$eval(selector, pageFunction, …args)
Evaluate JavaScript on all matching elements.
Returns T
evaluateHandle(pageFunction, …args)
Evaluate handle (returns a JSHandle).
Note: Handles are not fully supported in RPC mode - use evaluate instead.
Returns unknown
evaluateOnNewDocument(pageFunction, …args)
Add a script to evaluate when a new document is created.
Returns { identifier: string }
Cookies
cookies(…urls)
Get all cookies.
Returns PuppeteerCookie[]
setCookie(…cookies)
Set cookies.
deleteCookie(…cookies)
Delete cookies.
Lifecycle
bringToFront()
Bring page to front.
close()
Close the page.
Other
emulateMediaType(type?)
Emulate media type.
emulateMediaFeatures(features?)
Emulate media features.
emulateTimezone(timezoneId?)
Emulate timezone.
emulateVisionDeficiency(type?)
Emulate vision deficiency.
setGeolocation(geolocation)
Set geolocation.
setUserAgent(userAgent)
Set user agent.
setExtraHTTPHeaders(headers)
Set extra HTTP headers.
createCDPSession()
Create a CDP session.
Note: Returns a session identifier in RPC mode (not a live CDPSession).
Returns { sessionId: string }
sendCDP(method, params?)
Send a CDP command directly.
Returns T
metrics()
Get metrics.
Returns Record<string, number>
setJavaScriptEnabled(enabled)
Set JavaScript enabled/disabled.
setCacheEnabled(enabled)
Set cache enabled/disabled.
setOfflineMode(enabled)
Set offline mode.
emulateNetworkConditions(conditions)
Emulate network conditions.
addScriptTag(options)
Add script tag.
Returns PuppeteerSerializedElement
addStyleTag(options)
Add style tag.
Returns PuppeteerSerializedElement
setRequestInterception(enabled)
Set request interception enabled/disabled.
authenticate(credentials)
Authenticate with HTTP auth.
mainFrame()
Get the main frame.
Returns RemotePuppeteerFrame
frames()
Get all frames.
Returns RemotePuppeteerFrame[]
setDefaultNavigationTimeout(timeout)
Set the default navigation timeout.
setDefaultTimeout(timeout)
Set the default timeout.
getDefaultNavigationTimeout()
Get the default navigation timeout.
Returns number
getDefaultTimeout()
Get the default timeout.
Returns number
setBypassCSP(enabled)
Toggle bypassing Content-Security-Policy.
removeScriptToEvaluateOnNewDocument(identifier)
Remove an injected script.
removeExposedFunction(name)
Remove an exposed function.
emulate(device)
Emulate a device (viewport + user agent).
emulateCPUThrottling(factor)
Emulate CPU throttling.
emulateIdleState(overrides?)
Emulate idle state.
setBypassServiceWorker(bypass)
Set service worker bypass.
setDragInterception(enabled)
Set drag interception.
target()
Get the target for this page.
Returns PuppeteerTarget
workers()
Get all web workers for this page.
Returns PuppeteerWebWorker[]
windowId()
Get the window ID.
Returns number
resize(options)
Resize the page.
queryObjects(prototypeHandle)
Query all objects of a given prototype.
Returns RemotePuppeteerElementHandle
openDevTools(options?)
Open DevTools. Only works in headful mode.
Mouse
mouse.click(x, y, options?)
Click at specific coordinates.
mouse.move(x, y, options?)
Move mouse to specific coordinates.
mouse.down(options?)
Press mouse button down.
mouse.up(options?)
Release mouse button.
mouse.wheel(options?)
Scroll mouse wheel.
mouse.drag(start, target)
Dispatches a drag event.
Returns PuppeteerDragData
mouse.dragAndDrop(start, target, options?)
Perform a drag and drop operation.
mouse.dragEnter(target, data)
Dispatches a dragenter event.
mouse.dragOver(target, data)
Dispatches a dragover event.
mouse.drop(target, data)
Performs a dragenter, dragover, and drop in sequence.
mouse.reset()
Resets the mouse to the default state.
Keyboard
keyboard.down(key, options?)
Dispatches a keydown event.
If key is a single character and no modifier keys besides Shift are being held down,
a keypress/input event will also be generated. The text option can be specified
to force an input event to be generated.
Modifier keys DO affect keyboard.down. Holding down Shift will type the text in upper case.
keyboard.up(key)
Dispatches a keyup event.
keyboard.press(key, options?)
Shortcut for Keyboard.down and Keyboard.up.
If key is a single character and no modifier keys besides Shift are being held down,
a keypress/input event will also be generated. The text option can be specified
to force an input event to be generated.
Modifier keys DO affect keyboard.press. Holding down Shift will type the text in upper case.
keyboard.sendCharacter(char)
Dispatches a keypress and input event. This does not send a keydown or keyup event.
Modifier keys DO NOT affect keyboard.sendCharacter. Holding down Shift will not
type the text in upper case.
keyboard.type(text, options?)
Sends a keydown, keypress/input, and keyup event for each character in the text.
To press a special key, like Control or ArrowDown, use Keyboard.press.
Modifier keys DO NOT affect keyboard.type. Holding down Shift will not type the text
in upper case.
Touchscreen
touchscreen.tap(x, y)
Dispatches a touchstart and touchend event (simulates a tap).
touchscreen.touchStart(x, y)
Dispatches a touchstart event.
Returns a TouchHandle that can be used to dispatch touchMove and touchEnd events
for this specific touch point. This allows tracking individual touches in multi-touch scenarios.
The returned TouchHandle has:
move(x, y): Dispatches a touchmove event for this touchend(): Dispatches a touchend event for this touch
touchscreen.touchEnd()
Dispatches a touchend event.

