> For the complete documentation index, see [llms.txt](https://gaffa.dev/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gaffa.dev/docs/features/browser-requests/actions/capture-snapshot.md).

# Capture Snapshot

**Type:** `capture_snapshot`

This output type will return an HTML file that captures a static version of the page state. The page will load offline and can be saved to your local machine.

This will:

* Load and embed all images on the page.
* Embed all CSS files

Currently, JavaScript is disabled, and interactivity might not work as expected, but this feature should help preserve the page state as it was and allow you to view it offline.

<details>

<summary><strong>Tips for using <code>capture_snapshot</code> action</strong></summary>

* Use this when you want to revisit the page later. Unlike a screenshot, you can still read and search the HTML.
* JavaScript is switched off in the saved file, so anything interactive is frozen as it was.
* Open any tabs or expand any sections before you capture, because they won't open in the saved file.
* Snapshots are large, since every image and stylesheet is embedded in the file.

</details>

### Parameters

See [universal parameters](/docs/features/browser-requests/actions.md#universal-parameters)

### Usage

The following captures the current section of the page currently visible in the browser.

```json
"actions": [
    {
        "type": "capture_snapshot"
    }
]
```

### Example Output

Here's an example that shows an offline snapshot of a site

{% file src="/files/e5MQqPjILYNixHCus4iU" %}

### FAQs

#### When do I use the capture\_snapshot action?

Use it when you need a copy of a page to open and read later for record-keeping, evidence, or to check back on a page after it's changed or gone offline.

#### What does the capture\_snapshot action produce?

It produces a single HTML file with all the images and CSS built in, so the page opens offline on your machine without needing the original site or a network connection.

#### Does JavaScript work in a Gaffa snapshot?

No. JavaScript is disabled in the saved file, so tabs, carousels, and dropdowns won't respond. The snapshot keeps the page exactly as it was when you captured it.

#### How do I take a snapshot of a page with content behind a tab?

Add a [`click`](/docs/features/browser-requests/actions/click.md) for the tab, then a [`wait`](/docs/features/browser-requests/actions/wait.md) for its content to appear, then `capture_snapshot`. Scripts won't run in the saved file, so open everything you need beforehand.

#### When should I use capture\_screenshot instead of capture\_snapshot?

Use a screenshot when you just need to see the page. Use a snapshot when you'll want to read or pull data out of it later, since a snapshot is still HTML.

#### When should I use print instead of capture\_snapshot?

Use [`print`](/docs/features/browser-requests/actions/print.md) when you need a PDF to share or file. Use `capture_snapshot` when you need a working copy of how the page looked in the browser.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://gaffa.dev/docs/features/browser-requests/actions/capture-snapshot.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
