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

# Scrape pages behind a login

> Read pages that need an account, by passing your own session cookies or by logging in with browser actions. Cookies are never stored.

Some pages only show their content to signed-in users: dashboards, account pages, members-only sites. There are two ways to read them.

| Way | Best for |
| - | - |
| **Pass your session cookies** | Any site you're already signed in to in your browser. Works with Scrape, Batch scrape, Crawl and Map. |
| **Log in with browser actions** | Simple login forms with a username and password. Scrape only. |

## Pass your session cookies

1. Sign in to the site in Chrome, Edge or Firefox.
2. Open DevTools (`F12`), go to **Application** (Chrome, Edge) or **Storage** (Firefox), then **Cookies**, and pick the site.
3. Copy the cookies: either the ones that look like a session (`session`, `auth`, `token`, `sid`), or select every row and copy them all.
4. Send them in `cookies`:

```json theme={null}
{
  "urls": [{ "url": "https://app.example.com/reports" }],
  "prompt": "Extract the monthly traffic summary",
  "cookies": "session_id=abc123xyz; auth_token=eyJhbGciOiJ..."
}
```

`cookies` takes the usual `name=value; name=value` form, or the rows exactly as you copied them from Chrome's cookie table (tab-separated). Spidra reads the name, value, domain and path from each row and ignores the other columns.

The same field works on [Batch scrape](https://docs.spidra.io/batch-scrape.md), [Crawl](https://docs.spidra.io/crawl.md) and [Map](https://docs.spidra.io/map.md). In the dashboard, it's **Authentication** on the Scrape form and the **Login** tab under **More settings** on Crawl.

## Log in with browser actions

For a plain login form, type the details and submit before the page is read:

```json theme={null}
{
  "urls": [{
    "url": "https://quotes.toscrape.com/login",
    "actions": [
      { "type": "type", "selector": "#username", "value": "demo" },
      { "type": "type", "selector": "#password", "value": "demo" },
      { "type": "click", "selector": "input[type='submit']" },
      { "type": "waitFor", "selector": "a[href='/logout']" }
    ]
  }],
  "prompt": "List the first 3 quotes with their authors",
  "output": "json"
}
```

The `waitFor` on the Logout link confirms the login worked; if it didn't, the job fails at that step and costs nothing. What you type is never sent to the AI and is masked in your logs. Logins with a CAPTCHA, a one-time code or single sign-on usually need cookies instead.

## Good to know

* **Cookies are never stored.** They're used for the job and dropped. That's also why a [batch retry](https://docs.spidra.io/api-reference/scraping/batch-scrape-retry.md) needs them sent again.
* **Sessions expire.** If pages start coming back logged out, copy fresh cookies.
* **Copy from the right domain.** Cookies belong to one site; copy them from the domain you're scraping.
* **Use your own accounts.** You're responsible for following each site's terms and the law, including for content behind a login.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.