Skip to main content
This endpoint is a wrapper around the session.scrape method that automatically starts a new session, goes to the given URL, and scrapes the page. Example:
from notte_sdk import NotteClient

client = NotteClient()
markdown = client.scrape("https://www.google.com", only_main_content=False)
With structured data:
from notte_sdk import NotteClient
from pydantic import BaseModel

# Define your Pydantic model
...

client = NotteClient()
data = client.scrape(
    "https://www.notte.cc",
    response_format=Product,
    instructions="Extract the products names and prices"
)

Parameters

url
str
required
The URL to scrape.
raise_on_failure
bool
default:"True"
If True (default), raises ScrapeFailedError when structured data extraction fails and returns the extracted data directly. If False, returns the StructuredData wrapper so user can check .success.
selector
str | None
scrape_images
bool
only_main_content
bool
ignored_tags
list
only_images
bool
response_format
type[pydantic.main.BaseModel] | None
instructions
str | None

Returns

UnionType[StructuredData[BaseModel], BaseModel, Dict[str, Any], str, list[ImageData]]: returns the extracted data directly. When raise_on_failure=False: returns StructuredData wrapper so user can check .success. For markdown scraping: returns str. For image scraping: returns list[ImageData].