AI agent instructions
AI agent instructions
scrape. In the console it is Fetch.
Quick Start
Extract structured data from a page:Scraping Methods
Notte provides two ways to scrape:Quick Scrape
For simple scraping without session management:Session-Based Scrape
For scraping after authentication or navigation:Structured Extraction
Extract data into typed Python objects using Pydantic models. The extraction is powered by an LLM that understands the page content and extracts the specified fields.Using Pydantic Models
Define a schema and extract matching data:Using Instructions Only
For flexible extraction without a strict schema:Extracting Lists
Extract multiple items from a page:Nested Structures
Handle complex, nested data:Configuration Options
Content Filtering
Control what content gets extracted:Links
Control link extraction:Scoped Scraping
Scrape only a specific section of the page:Link Placeholders
Reduce output size by using placeholders:Extraction Model
When you passinstructions or response_format, the extraction runs on the platform’s default model. Set model to use a different one, for example client.scrape(url, instructions="...", model="anthropic/claude-sonnet-4-5-20250929").
Return Types
The scrape method returns different types based on parameters:
Pass
raise_on_failure=False to get a StructuredData wrapper with success, error, and data fields instead.
Structured Response
When using structured extraction, the extracted data is returned directly:Use Cases
Data Collection
Collect product information:Content Monitoring
Track content changes:Research and Analysis
Extract structured research data:Best Practices
1. Use Specific Instructions
Clear instructions improve extraction accuracy:2. Define Precise Schemas
Match your schema to the actual page content:3. Handle Missing Data
Use optional fields for data that might not exist:4. Scope Your Scrapes
Use selectors to focus on relevant content:Next Steps
Browser Sessions
Learn about session management
Search
Find pages before you fetch them
Vaults
Store credentials for authenticated scraping
Functions
Deploy scraping as serverless functions
Multi-step extraction
Useclient.scrape() for a single URL, or session.scrape() after navigation and authentication:
authenticated_scrape.py
schema_design.py
Local Python extraction configuration
Installnotte[llm] and set OPENROUTER_API_KEY for local structured extraction.
The default model is google/gemini-3.5-flash-lite at https://openrouter.ai/api/v1.
Cloud sessions use the platform’s server-side extraction configuration.
For another OpenAI-compatible endpoint, set NOTTE_LLM_API_KEY and use the endpoint’s own model ID:
- OpenAI:
NOTTE_LLM_BASE_URL=https://api.openai.com/v1,NOTTE_LLM_MODEL=gpt-4o. - Gemini:
NOTTE_LLM_BASE_URL=https://generativelanguage.googleapis.com/v1beta/openai,NOTTE_LLM_MODEL=gemini-3.5-flash-lite. - Ollama/custom:
NOTTE_LLM_BASE_URL=http://localhost:11434/v1,NOTTE_LLM_MODELset to your local model, andNOTTE_LLM_API_KEY=ollamafor an unauthenticated local server. Ollama is documented but has not been live-tested.
NOTTE_LLM_API_KEY takes precedence over OPENROUTER_API_KEY; the latter is only used at the default
OpenRouter URL. Custom endpoints require an explicit model, supplied through NOTTE_LLM_MODEL or
LlmExtractor(model=...). A model passed to extract(..., model=...) applies to that call only.
NOTTE_LLM_TEMPERATURE defaults to 0.0, NOTTE_LLM_NB_RETRIES_STRUCTURED_OUTPUT to 2, and
NOTTE_LLM_CONTEXT_TOKENS to 128000. Document clipping estimates four characters per token.
The client uses a 60-second HTTP timeout and retries transient errors after 2 and 5 seconds.
Typed extraction tries strict schemas, then JSON-object output with the schema in the prompt;
if the endpoint rejects JSON-object mode as well, the schema stays in the prompt alone.