Skip to content

Latest commit

 

History

History

README.md

stagehand (Python)

AI-powered browser automation using Stagehand library.

Run on Intuned

APIs

API Description
get-books Scrapes books from books.toscrape.com using Stagehand's AI-powered act/observe/extract methods, with optional category filtering and automatic pagination

Getting Started

Install dependencies

uv sync

If the intuned CLI is not installed, install it globally:

npm install -g @intuned/cli

After installing dependencies, intuned command should be available in your environment.

Prepare the project

Before running any API, provision and deploy the project first.

intuned dev provision
intuned dev deploy

Run an API

intuned dev run api get-books .parameters/api/get-books/travel-category.json
intuned dev run api get-books .parameters/api/get-books/no-category-all-books.json

Project Structure

stagehand/
├── api/
│   └── get-books.py                   # Scrapes books by category using Stagehand AI methods
├── hooks/
│   └── setup_context.py               # Stores CDP URL in attempt_store before each API call
├── intuned-resources/
│   └── jobs/
│       └── get-books.job.jsonc        # Job definition for get-books API
├── .parameters/
│   └── api/
│       └── get-books/
│           ├── travel-category.json
│           └── no-category-all-books.json
├── Intuned.jsonc
├── pyproject.toml
└── README.md

Related