> ## Documentation Index
> Fetch the complete documentation index at: https://notte-experiment-visibility-md-links.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# scrape

> Scrape the current page data

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:**

```python theme={null}
from notte_sdk import NotteClient

client = NotteClient()
with client.Session() as session:
    session.execute(type="goto", url="https://www.google.com")
    markdown = session.scrape(only_main_content=False)
```

With structured data:

```python theme={null}
from notte_sdk import NotteClient
from pydantic import BaseModel

# Define your Pydantic model
...

client = NotteClient()
with client.Session() as session:
    session.execute(type="goto", url="https://www.notte.cc")
    data = session.scrape(
        response_format=Product,
        instructions="Extract the products names and prices"
    )
```

## Parameters

<ParamField path="raise_on_failure" type="bool" default="True" />

<ParamField path="selector" type="str | None" />

<ParamField path="scrape_links" type="bool" />

<ParamField path="scrape_images" type="bool" />

<ParamField path="only_main_content" type="bool" />

<ParamField path="use_link_placeholders" type="bool" />

<ParamField path="ignored_tags" type="list" />

<ParamField path="only_images" type="bool" />

<ParamField path="response_format" type="type[pydantic.main.BaseModel] | None" />

<ParamField path="instructions" type="str | None" />

## Returns

`UnionType`\[[`StructuredData[BaseModel]`](/sdk-reference/misc/structureddata.md), [`BaseModel`](/sdk-reference/misc/basemodel.md), `Dict`\[`str`, `Any`], `str`, `list`\[[`ImageData`](/sdk-reference/misc/imagedata.md)]]: An Observation object containing metadata, screenshot, action space, and data space.
