Page with AI methods added. Every Playwright method still works; the methods below are the ones Skyvern adds or extends. Most accept a CSS selector, a natural-language prompt, or both (the selector is tried first and AI is the fallback).
AI methods
page.act
Perform an action on the page using AI based on a natural language prompt.str
required
Natural language description of the action to perform.
bool
Default:
False · Python onlybool
Default:
False · Python onlyNone · TypeScript Promise<void>
Example
page.extract
Extract structured data from the page using AI.str
required
Natural language description of what data to extract.
dict[str, Any] | list | str | None
JSON Schema defining the structure of data to extract.Default:
Nonedict[str, str] | None
Mapping of error codes to custom error messages.Default:
None · TypeScript: errorCodeMappingstr | None
Additional context about the extraction intent.Default:
Nonestring | Record<string, unknown>
TypeScript only
dict[str, Any] | list | str | None · TypeScript Promise<Record<string, unknown> | unknown[] | string | null> — Extracted data matching the provided schema, or None if extraction fails.
Example
page.validate
Validate the current page state using AI.str
required
Validation criteria or condition to check
dict[str, Any] | str | None
Optional model configuration. Can be either: - A dict with model configuration (e.g., {“model_name”: “gemini-3.0-flash”, “max_tokens”: 2048}) - A string with just the model name (e.g., “gpt-4”)Default:
Nonebool · TypeScript Promise<boolean> — True if validation passes, False otherwise
Example
page.prompt
Send a prompt to the LLM and get a response based on the provided schema. This method allows you to interact with the LLM directly without requiring page context. It’s useful for making decisions, generating text, or processing information using AI.str
required
The prompt to send to the LLM
dict[str, Any] | None
Optional JSON schema to structure the response. If provided, the LLM response will be validated against this schema.Default:
Nonedict[str, Any] | str | None
Optional model configuration. Can be either: - A dict with model configuration (e.g., {“model_name”: “gemini-3.0-flash”, “max_tokens”: 2048}) - A string with just the model name (e.g., “gemini-3.0-flash”)Default:
Nonedict[str, Any] | list | str | None · TypeScript Promise<Record<string, unknown> | unknown[] | string | null> — LLM response structured according to the schema if provided, or unstructured response otherwise.
Example
page.locator
Get a Playwright locator using a CSS selector, AI-powered prompt, or both. This method extends Playwright’s locator() with AI capabilities. It supports three modes:- Selector-based: Get locator using CSS selector (standard Playwright behavior)
- AI-powered: Use natural language to describe the element (returns lazy AILocator)
- Fallback mode (default): Try the selector first, fall back to AI if it fails
Python only: the TypeScript SDK has no equivalent.
str | None
CSS selector for the target element.Default:
Nonestr | None
Natural language description of which element to locate.Default:
Nonestr | None
AI behavior mode. Defaults to “fallback” which tries selector first, then AI.Default:
'fallback'Any
All Playwright locator parameters (has_text, has, etc.)Sent only when you pass it
Locator — A Playwright Locator object (or AILocator proxy that acts like one).
Example
Element actions
page.click
Click an element using a CSS selector, AI-powered prompt matching, or both. This method supports three modes:- Selector-based: Click the element matching the CSS selector
- AI-powered: Use natural language to describe which element to click
- Fallback mode (default): Try the selector first, fall back to AI if it fails
str | None
CSS selector for the target element.Default:
Nonestr | None
Natural language description of which element to click.Default:
Nonestr | None
AI behavior mode. Defaults to “fallback” which tries selector first, then AI.Default:
'fallback' · Python onlystr | None
When
"direct", perform a raw Playwright click with no AI fallback or element preparation. The action is still recorded in the DB so it appears in the timeline.Default: None · Python onlybool | None
Level-triggered toggle intent recorded with the action. When set, a selector-first click is suppressed if the control already holds that state, so a replay never toggles an already-satisfied control back off. Ignored by
mode="direct".Default: None · Python onlyAny
All Playwright click parameters (timeout, force, modifiers, etc.)Sent only when you pass it · Python only
Parameters<Page["click"]>[1]
Playwright options for this call.TypeScript only
str | None · TypeScript Promise<void> — The selector string that was successfully used to click the element, or None.
Example
page.fill
Fill an input field using a CSS selector, AI-powered prompt matching, or both. This method supports three modes:- Selector-based: Fill the input field with a value using CSS selector
- AI-powered: Use natural language prompt (AI extracts value from prompt)
- Fallback mode (default): Try the selector first, fall back to AI if it fails
str | None
CSS selector for the target input element.Default:
Nonestr | None
The text value to input into the field.Default:
Nonestr | None
Natural language description of which field to fill and what value.Default:
Nonestr | None
AI behavior mode. Defaults to “fallback” which tries selector first, then AI.Default:
'fallback' · Python onlystr | None
When
"direct", perform a raw Playwright fill with no AI fallback or element preparation. The action is still recorded in the DB so it appears in the timeline.Default: None · Python onlystr | None
TOTP identifier for time-based one-time password fields.Default:
None · Python onlystr | None
URL to fetch TOTP codes from for authentication.Default:
None · Python onlyParameters<Page["fill"]>[2]
Playwright options for this call.TypeScript only
str · TypeScript Promise<void> — The value that was successfully filled into the field.
Example
page.select_option
Select an option from a dropdown using a CSS selector, AI-powered prompt matching, or both. This method supports three modes:- Selector-based: Select the option with a value using CSS selector
- AI-powered: Use natural language prompt (AI extracts value from prompt)
- Fallback mode (default): Try the selector first, fall back to AI if it fails
str | None
CSS selector for the target select/dropdown element.Default:
Nonestr | None
The option value to select.Default:
Nonestr | None
Natural language description of which option to select.Default:
Nonestr | None
AI behavior mode. Defaults to “fallback” which tries selector first, then AI.Default:
'fallback' · Python onlystring | string[]
TypeScript only
Parameters<Page["selectOption"]>[2]
Playwright options for this call.TypeScript only
str | None · TypeScript Promise<void> — The value that was successfully selected.
Example
page.type
Enter text into an input using a selector, AI, or both. Behaves the same asfill.
With a selector, the value is set in one step (Playwright’s fill), not typed key by key. For inputs
that need real key events, use fill_autocomplete, keypress, or press_sequentially on a Playwright locator.
Python only: the TypeScript SDK has no equivalent.
str | None
CSS selector for the input.Default:
Nonestr | None
The text to enter.Default:
Nonestr | None
AI behavior mode. Defaults to “fallback”, which tries the selector first, then AI.Default:
'fallback'str | None
Natural language description of which input to type into.Default:
Nonestr | None
Identifier of the 2FA code to type, when
value is a TOTP placeholder.Default: Nonestr | None
URL Skyvern calls to fetch the 2FA code, when
value is a TOTP placeholder.Default: NoneAny
Playwright options such as
timeout.Sent only when you pass itstr — The value that was entered.
Example
page.hover
Move the mouse over the element identified byselector.
Python only: the TypeScript SDK has no equivalent.
str
required
CSS selector for the element.
float
Maximum time to wait for the element, in milliseconds.Default:
5000float
How long to keep the mouse over the element, in seconds.Default:
0.0str | None
Description of why you are hovering, recorded with the action.Default:
Nonestr — The selector that was hovered.
Example
page.upload_file
Upload a file to a file input, using a selector, AI, or both.Python only: the TypeScript SDK has no equivalent.
str | None
CSS selector for the file input.Default:
Nonestr | None
URL of the file to upload. One file per call.Default:
Nonestr | None
Natural language description of which file input to use.Default:
Nonestr | None
AI behavior mode. With the default “fallback”, a selector-only call uploads through the selector. When a prompt is passed, the selector is tried first and AI then always runs the upload, using the selector only if it worked.Default:
'fallback'str — The file URL that was uploaded.
Example
page.keypress
Press one or more keys, such as["Enter"] or ["Control", "a"].
Python only: the TypeScript SDK has no equivalent.
list[str]
required
Keys to press, using Playwright key names.
bool
Hold the keys down for
duration seconds instead of tapping them.Default: Falsefloat
How long to hold the keys, in seconds, when
hold is true.Default: 0None
Example
page.scroll
Scroll the page by a number of pixels.Python only: the TypeScript SDK has no equivalent.
int
required
Pixels to scroll horizontally (negative scrolls left).
int
required
Pixels to scroll vertically (negative scrolls up).
None
Example
page.drag
Drag with the mouse from a start point along a path of points.Python only: the TypeScript SDK has no equivalent.
int
required
Horizontal start position in pixels.
int
required
Vertical start position in pixels.
list[tuple[int, int]]
required
Points
(x, y) to drag through, ending where the mouse is released.None
Example
page.move
Move the mouse cursor to a point on the page.Python only: the TypeScript SDK has no equivalent.
int
required
Horizontal position in pixels from the left of the viewport.
int
required
Vertical position in pixels from the top of the viewport.
None
Example
page.wait
Pause the script for a fixed time, recorded as a wait action.Python only: the TypeScript SDK has no equivalent.
float | None
How long to wait, in seconds.Default:
NoneNone
Example
page.download_file
Download a file from a URL and save it locally during cached script replay.Python only: the TypeScript SDK has no equivalent.
str | None
The original file name (for logging/reference). Defaults to UUID if empty.Default:
Nonestr | None
The URL to download the file from.Default:
Nonestr — The local file path where the file was saved.
Example
page.reload_page
Reload the current page, recorded as an action.Python only: the TypeScript SDK has no equivalent.
None
Example

