# --wait-for

Source: https://zshot-cli.com/reference/flags/common/wait-for/
Markdown: https://zshot-cli.com/reference/flags/common/wait-for/index.md
Section: [Reference](https://zshot-cli.com/reference/) › [Flags](https://zshot-cli.com/reference/flags/) › [Common](https://zshot-cli.com/reference/flags/common/)
CLI: `--wait-for` · REST: [`wait_for`](https://zshot-cli.com/reference/server/api/schema/#wait_for)
Default: `load`

Sets when the page is captured.

| Value | When |
| --- | --- |
| `load` | The `window.load` event |
| `ready` | The `DOMContentLoaded` event |
| `networkidle0` | After the `load` event, once no request has started or finished for 500ms |
| `networkidle2` | After the `load` event, once no request has started or finished for 1 second, with up to two still open |
| `js:NAME_OF_EVENT` | When a `CustomEvent` of that name fires on `window`: `js:my_event` captures once the page runs `window.dispatchEvent(new CustomEvent("my_event"))` |
| `css:SELECTOR` | When a DOM element matching this selector exists on the page |
| **Any number** | That many seconds after `DOMContentLoaded`: `5`, `2.5`, or `0` for no delay |

## Delays

Append seconds to `networkidle0` or `networkidle2` to wait that much longer once the network is idle: `networkidle0:2.5`.

## Redirects

To capture the destination of a redirect that fires after the page loads, such as a delayed meta-refresh or a timed script redirect, set a number of seconds larger than the redirect delay.

## Example

**CLI**

```sh
zshot --wait-for 5 https://zshot-cli.com/
```

**JSON** — `POST /` body for the [API](/reference/server/api), Pro license

```json
{
  "url": "https://zshot-cli.com/",
  "output_type": "png",
  "wait_for": "5"
}
```

**curl**

```sh
curl -X POST http://127.0.0.1:3000/ \
  -H "Content-Type: application/json" \
  -d '{"url":"https://zshot-cli.com/","output_type":"png","wait_for":"5"}' \
  -o page.png
```

## Related

Flags:

- [`--timeout`](https://zshot-cli.com/reference/flags/common/timeout/)

Topics:

- [Timeouts](https://zshot-cli.com/reference/timeouts/)

## Navigation

- [Examples](https://zshot-cli.com/examples/)
- [Download](https://zshot-cli.com/download/)
- [Purchase](https://zshot-cli.com/purchase/)
- [Reference](https://zshot-cli.com/reference/)
  - [Formats](https://zshot-cli.com/reference/formats/)
  - [Flags](https://zshot-cli.com/reference/flags/)
    - [Common](https://zshot-cli.com/reference/flags/common/)
      - [--completions](https://zshot-cli.com/reference/flags/common/completions/)
      - [--config](https://zshot-cli.com/reference/flags/common/config/)
      - [--diagnostics](https://zshot-cli.com/reference/flags/common/diagnostics/)
      - [--file-name](https://zshot-cli.com/reference/flags/common/file-name/)
      - [--formats](https://zshot-cli.com/reference/flags/common/formats/)
      - [--input-mimetype](https://zshot-cli.com/reference/flags/common/input-mimetype/)
      - [--license-info](https://zshot-cli.com/reference/flags/common/license-info/)
      - [--license-key](https://zshot-cli.com/reference/flags/common/license-key/)
      - [--log-chrome-to-stderr](https://zshot-cli.com/reference/flags/common/log-chrome-to-stderr/)
      - [--log-level](https://zshot-cli.com/reference/flags/common/log-level/)
      - [--no-fail](https://zshot-cli.com/reference/flags/common/no-fail/)
      - [--no-timeout](https://zshot-cli.com/reference/flags/common/no-timeout/)
      - [--open-source-licenses](https://zshot-cli.com/reference/flags/common/open-source-licenses/)
      - [--output-type](https://zshot-cli.com/reference/flags/common/output-type/)
      - [--quiet](https://zshot-cli.com/reference/flags/common/quiet/)
      - [--refresh-license](https://zshot-cli.com/reference/flags/common/refresh-license/)
      - [--software-rendering](https://zshot-cli.com/reference/flags/common/software-rendering/)
      - [--timeout](https://zshot-cli.com/reference/flags/common/timeout/)
      - [--trial](https://zshot-cli.com/reference/flags/common/trial/)
      - **--wait-for**
    - [Agents](https://zshot-cli.com/reference/flags/agents/)
    - [Archive](https://zshot-cli.com/reference/flags/archive/)
    - [Browser](https://zshot-cli.com/reference/flags/browser/)
    - [Diagnostics](https://zshot-cli.com/reference/flags/diagnostics/)
    - [Document](https://zshot-cli.com/reference/flags/document/)
    - [Image](https://zshot-cli.com/reference/flags/image/)
    - [Navigator](https://zshot-cli.com/reference/flags/navigator/)
    - [Security](https://zshot-cli.com/reference/flags/security/)
    - [Server](https://zshot-cli.com/reference/flags/server/)
    - [Video](https://zshot-cli.com/reference/flags/video/)
  - [Agents](https://zshot-cli.com/reference/agents/)
  - [Configuration](https://zshot-cli.com/reference/configuration/)
  - [Crawling](https://zshot-cli.com/reference/crawling/)
  - [Docker](https://zshot-cli.com/reference/docker/)
  - [Exit Codes](https://zshot-cli.com/reference/exit_codes/)
  - [Linux](https://zshot-cli.com/reference/linux/)
  - [LLM Connections](https://zshot-cli.com/reference/llm_connections/)
  - [LLM Formatting](https://zshot-cli.com/reference/llm_formatting/)
  - [Local Inputs](https://zshot-cli.com/reference/inputs/)
  - [Navigator](https://zshot-cli.com/reference/navigator/)
  - [Security](https://zshot-cli.com/reference/security/)
  - [Server](https://zshot-cli.com/reference/server/)
  - [Shell completions](https://zshot-cli.com/reference/shell_completions/)
  - [Storage](https://zshot-cli.com/reference/storage/)
  - [Timeouts](https://zshot-cli.com/reference/timeouts/)
  - [Web Bot Auth](https://zshot-cli.com/reference/web_bot_auth/)
- [Support](https://zshot-cli.com/support/)
- [Changelog](https://zshot-cli.com/changelog/)

Site index: https://zshot-cli.com/llms.txt

