Skip to main content

Overview

The AI Extract step uses AI vision to intelligently extract data from the page based on natural language descriptions. Unlike the standard Extract Value step that requires precise CSS selectors, AI Extract can find and extract information by understanding what you’re looking for in plain English.

When to Use AI Extract

AI Extract is ideal when you need to:
  • Extract data without knowing exact selectors: When elements don’t have stable selectors or IDs
  • Extract from dynamic content: When element structure changes but the visual content remains consistent
  • Extract complex information: When the data spans multiple elements or requires interpretation
  • Handle visual context: When you need to extract based on visual position or appearance

How It Works

AI Extract takes a screenshot of the current page, analyzes it using AI vision, and extracts the requested information based on your prompt. The extracted value is stored in a variable that you can use in subsequent steps.

Configuration

FieldTypeRequiredDescription
PrompttextYesNatural language description of what to extract
Variable NametextYesName for storing the extracted value
Element TargetlocatorNoOptional element to focus the extraction area

Prompt Field

Write a clear description of what data you want to extract. Be specific about:
  • What information you’re looking for
  • Where it’s located on the page (if helpful)
  • The format you expect

Variable Name

The extracted value will be stored in this variable. Access it in later steps using {{ vars.variableName }}.

Element Target (Optional)

Optionally target a specific element to narrow down the extraction area. This can improve accuracy and speed by focusing the AI on a specific region of the page.

Examples

Extract a Price

Prompt: Extract the total price shown in the cart summary
Variable Name: totalPrice
Result: "$149.99" Use in later steps: {{ vars.totalPrice }}

Extract Order Information

Prompt: Extract the order confirmation number displayed after checkout
Variable Name: orderNumber
Result: "ORD-2024-78534"

Extract User Data

Prompt: Extract the logged-in user's email address shown in the header
Variable Name: userEmail
Result: "[email protected]"

Extract Status Information

Prompt: What is the current status of the order? Extract just the status text.
Variable Name: orderStatus
Result: "Shipped"

Extract from a Specific Element

Prompt: Extract the product name from this card
Variable Name: productName
Element Target: .product-card:first-child
This focuses the AI on just the first product card, improving accuracy.

Real-World Scenarios

E-commerce Checkout Flow

Step 1: AI Extract
  Prompt: Extract the subtotal amount before taxes
  Variable Name: subtotal

Step 2: AI Extract
  Prompt: Extract the tax amount
  Variable Name: taxAmount

Step 3: AI Extract
  Prompt: Extract the final total including shipping
  Variable Name: finalTotal

Step 4: Verify Value
  Locator: .order-summary
  Expected: {{ vars.finalTotal }}

Dynamic Content Extraction

Step 1: Click
  Locator: button[data-action='generate-report']

Step 2: AI Extract
  Prompt: Extract the report ID that was just generated
  Variable Name: reportId

Step 3: Navigate
  URL: /reports/{{ vars.reportId }}

Multi-Element Extraction

Step 1: AI Extract
  Prompt: Extract all visible product names as a comma-separated list
  Variable Name: productList

Step 2: Run Python
  Code: |
    products = vars.productList.split(', ')
    return len(products)
  Variable Name: productCount

AI Extract vs Extract Value

FeatureAI ExtractExtract Value
Selection methodNatural language promptCSS selector
Best forDynamic content, complex layoutsStable elements with good selectors
SpeedSlower (uses AI processing)Faster (direct DOM access)
AccuracyContext-aware, handles variationsPrecise, requires exact match
AI CreditsConsumes AI creditsNo credits used
When to use AI Extract:
  • Elements lack stable selectors
  • Content structure varies
  • You need to extract based on visual context
  • Selectors would be too fragile
When to use Extract Value:
  • Elements have reliable data-testid or stable attributes
  • Speed is important
  • You want to avoid AI credit usage
  • Simple text extraction from a known element

Best Practices

Write Clear Prompts

  • Be specific: “Extract the order total” is better than “Extract the number”
  • Provide context: “Extract the discount percentage shown in red” helps AI identify the right value
  • Specify format: “Extract the date in MM/DD/YYYY format” when format matters

Use Element Targeting

When possible, use the element target to narrow the extraction area:
  • Improves accuracy by reducing visual noise
  • Speeds up extraction
  • Reduces the chance of extracting wrong values

Name Variables Meaningfully

Use descriptive names that indicate what the variable contains:
  • orderConfirmationNumber instead of num
  • shippingCost instead of cost
  • customerEmail instead of email1

Troubleshooting

Extracted Value Is Wrong

Symptom: AI extracts incorrect or unexpected data Solution:
  • Make your prompt more specific
  • Use element targeting to focus the extraction area
  • Include more context in your prompt about where the data is located
  • Check if the page has fully loaded before extraction

Extraction Fails

Symptom: Step fails with extraction error Solution:
  • Ensure the page has fully loaded
  • Add a Wait for Element step before extraction
  • Check that the content is visible on screen (not scrolled out of view)
  • Verify the prompt is clear and unambiguous

Variable Not Available

Symptom: {{ vars.myVar }} doesn’t resolve in later steps Solution:
  • Verify the AI Extract step completed successfully
  • Check the variable name is alphanumeric only
  • Ensure you’re referencing the variable in a step that runs after extraction

Slow Extraction

Symptom: AI Extract takes a long time Solution:
  • Use element targeting to reduce the analysis area
  • Ensure you’re not extracting from an unnecessarily large page section
  • Consider if Extract Value would work for your use case

AI Credits

AI Extract consumes 1 AI credit per execution. Monitor your usage in the AI Credits dashboard.