Skip to main content
Browser automation helpers for Python, built on Playwright. This package provides utilities for common automation tasks—AI-powered data extraction, navigation with retries, pagination handling, and more.

Installation

pip install intuned-browser
When using Intuned, this package is pre-installed in every Python project.

Quick example

from typing import TypedDict

from playwright.async_api import Page
from intuned_browser.ai import extract_structured_data, is_page_loaded
from intuned_browser.helpers import go_to_url

class Params(TypedDict):
    pass

async def automation(page: Page, params:Params, **kwargs):
    await go_to_url(page, "https://books.toscrape.com")
    loaded = await is_page_loaded(page)
    if not loaded:
      raise ValueError("Page is not loaded, can not extract data")

    # Extract all book listings from the page
    books = await extract_structured_data(
        source=page,
        data_schema={
            "type": "object",
            "properties": {
                "products": {
                    "type": "array",
                    "items": {
                        "type": "object",
                        "properties": {
                            "title": {"type": "string"},
                            "price": {"type": "string"}
                        }
                    }
                }
            }
        },
        prompt="Extract all book listings with their titles and prices",
        strategy="HTML",
        model="claude-haiku-4-5-20251001"
    )

    return books

AI module

AI-powered utilities for data extraction and page analysis. These functions use AI and incur costs.
FunctionDescription
extract_structured_dataExtract structured data from pages using AI with schema validation
is_page_loadedDetect when a page has finished loading
AI functions support caching and matching to reduce costs.

Helpers module

FunctionDescription
go_to_urlNavigate with automatic retries and error handling
wait_for_network_settledWait for network requests to complete
wait_for_dom_settledWait for DOM mutations to finish
scroll_to_load_contentLoad infinite-scroll content
click_until_exhaustedClick “Load More” buttons until all content loads
extract_markdownConvert pages to markdown
download_fileDownload files with different triggers
save_file_to_s3Download and upload files to S3
upload_file_to_s3Upload files with custom S3 configurations
filter_empty_valuesRemove empty values from data
validate_data_using_schemaValidate data against schemas
process_dateParse and normalize dates
sanitize_htmlClean and sanitize HTML
resolve_urlResolve relative URLs to absolute paths

Requirements

  • Python 3.8+
  • Playwright (pip install playwright && playwright install)
  • For AI functions: API key for your AI provider (set via environment variable or function parameter)