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.None · TypeScript Promise<void>
Example
page.extract
Extract structured data from the page using AI.JSON Schema defining the structure of data to extract.Default:
NoneMapping of error codes to custom error messages.Default:
None · TypeScript: errorCodeMappingdict[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.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.Optional JSON schema to structure the response. If provided, the LLM response will be validated against this schema.Default:
NoneOptional 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.
AI behavior mode. Defaults to “fallback” which tries selector first, then AI.Default:
'fallback'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
AI behavior mode. Defaults to “fallback” which tries selector first, then AI.Default:
'fallback' · Python onlyWhen
"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 onlyLevel-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 onlyAll Playwright click parameters (timeout, force, modifiers, etc.)Sent only when you pass it · Python 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
AI behavior mode. Defaults to “fallback” which tries selector first, then AI.Default:
'fallback' · Python onlyWhen
"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 · 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
AI behavior mode. Defaults to “fallback” which tries selector first, then AI.Default:
'fallback' · Python onlystr | 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.
AI behavior mode. Defaults to “fallback”, which tries the selector first, then AI.Default:
'fallback'str — 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 — 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.
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.
None
Example
page.scroll
Scroll the page by a number of pixels.Python only: the TypeScript SDK has no equivalent.
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.
None
Example
page.move
Move the mouse cursor to a point on the page.Python only: the TypeScript SDK has no equivalent.
None
Example
page.wait
Pause the script for a fixed time, recorded as a wait action.Python only: the TypeScript SDK has no equivalent.
None
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 — 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

