Skip to main content
A Skyvern page is a Playwright 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.
Parameters Returns None · TypeScript Promise<void> Example

page.extract

Extract structured data from the page using AI.
Parameters 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.
Parameters 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.
Parameters 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:
  1. URL pattern matching against current URL (FREE)
  2. Text substring check in page content (FREE)
  3. LLM-based classification as last resort (~$0.001)
Python only: the TypeScript SDK has no equivalent.
Parameters 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
The AI-powered locator is lazy - it only calls ai_locate_element when you actually use the locator (e.g., when you call .click(), .fill(), etc.). Note that using this AI locator lookup with prompt only works for elements you can interact with on the page.
Python only: the TypeScript SDK has no equivalent.
Parameters 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.
Parameters 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
Parameters 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
Parameters 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
Parameters 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 as fill. 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.
Parameters Returns str — The value that was entered. Example

page.hover

Move the mouse over the element identified by selector.
Python only: the TypeScript SDK has no equivalent.
Parameters 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.
Parameters 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.
Parameters Returns None Example

page.scroll

Scroll the page by a number of pixels.
Python only: the TypeScript SDK has no equivalent.
Parameters 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.
Parameters Returns None Example

page.move

Move the mouse cursor to a point on the page.
Python only: the TypeScript SDK has no equivalent.
Parameters 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.
Parameters 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.
Parameters 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.
Returns None Example