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.
Returns
None · TypeScript Promise<void>
Example
page.extract
Extract structured data from the page using AI.
Returns
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.
Returns
bool · 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.
Returns
dict[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.classify
Classify the current page state against named options using a tiered cascade. This method uses a three-tier approach to minimize cost:- URL pattern matching against current URL (FREE)
- Text substring check in page content (FREE)
- LLM-based classification as last resort (~$0.001)
Python only: the TypeScript SDK has no equivalent.
Returns
str — The matching option key, or “UNKNOWN” if no option matches.
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.
Returns
Locator — A Playwright Locator object (or AILocator proxy that acts like one).
Example
page.element_fallback
Activate the AI agent from the CURRENT page position to achieve a goal. Instead of re-running the entire block when cached code encounters an unknown state, this method activates the AI agent from the current page position. Much cheaper than a full block re-execution.Python only: the TypeScript SDK has no equivalent.
Returns
None
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
Returns
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
Returns
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
Returns
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.
Returns
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.
Returns
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.
Returns
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.
Returns
None
Example
page.scroll
Scroll the page by a number of pixels.Python only: the TypeScript SDK has no equivalent.
Returns
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.
Returns
None
Example
page.move
Move the mouse cursor to a point on the page.Python only: the TypeScript SDK has no equivalent.
Returns
None
Example
page.wait
Pause the script for a fixed time, recorded as a wait action.Python only: the TypeScript SDK has no equivalent.
Returns
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.
Returns
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

