> ## Documentation Index
> Fetch the complete documentation index at: https://docs.notte.cc/llms.txt
> Use this file to discover all available pages before exploring further.

# DownloadFileAction

> Download files from interactive elements

<Tip>
  STOP. Do not read past this section until you have read and followed [/quickstart.md](/quickstart.md).

  Goal: produce a reliable SDK automation script. The intended authoring flow is generate then edit, not write browser automation from scratch.

  Do not hand-write SDK code with element IDs, selectors, or form fields from memory. Element IDs, selectors, and field mappings must come from a live `observe()` call, CLI `notte page observe` output, or generated workflow code. Guessed browser targets fail on real pages.

  Use the Notte skill and CLI to inspect the live site, validate actions/selectors, handle auth/session state, and export workflow code with `notte sessions workflow-code` before using SDK docs or SDK code.

  SDK reference pages are for understanding, running, or editing generated workflow code. They are not the starting point for manually authoring the initial browser automation. SDK-first code is guesswork on real-world pages with dynamic selectors, auth state, CAPTCHAs, and anti-bot behavior.
</Tip>

Use with any clickable download file element, including button, a, span, div. CRITICAL: Use only this for file download, do not use click.

**Example:**

```python theme={null}
session.execute(type="download_file", id="download-button")
session.execute(type="download_file", id="report-link")
# Use the following selection if you want to download a raw PDF, DOCX, file.
session.execute(type="download_file", id="html")
```

## Fields

<ParamField path="type" type="Literal['download_file']" default="download_file" />

<ParamField path="category" type="str" default="Interaction Actions" />

<ParamField path="description" type="str" default="Download files from interactive elements. Use with any clickable element which triggers a download, including button, a, div. This action can also be used to download pages which are raw files (ex. PDF viewer). CRITICAL: Use only this for file download, DO NOT use click." />

<ParamField path="id" type="str" default="" />

<ParamField path="selector" type="UnionType[str, NodeSelectors, None]" />

<ParamField path="press_enter" type="UnionType[bool, None]" />

<ParamField path="text_label" type="UnionType[str, None]" />

<ParamField path="param" type="UnionType[ActionParameter, None]" />

<ParamField path="timeout" type="int" default="5000">
  Action timeout in milliseconds
</ParamField>

## Module

`notte_core.actions.actions`
