Captures an authenticated browser session so wc scrape can access pages behind a login.
wc session <url>
wc session <url> --output my-session.json| Option | Description | Default |
|---|---|---|
<url> |
URL to open (login page or any protected page) | — |
-o, --output <file> |
Path to save the session file | session.json |
- Opens a visible browser window at the given URL
- You log in manually in the browser
- Press Enter in the terminal when done
- The session (cookies + localStorage) is saved to the output file
wc session https://docs.example.com/login
# → browser opens, you log in, press Enter
# → session saved to session.jsonSet storage_state in your config.json under playwright_config:
{
"scrape": {
"playwright_config": {
"storage_state": "session.json"
}
}
}The session is loaded into the Playwright browser context. Use this when the site requires JavaScript rendering in addition to authentication.
Cookies from the session file are extracted and injected as a Cookie header into native fetch requests. This is faster — no browser overhead — and works for sites that only need the auth cookie, not JS rendering.
{
"scrape": {
"playwright": false,
"playwright_config": {
"storage_state": "session.json"
}
}
}Sessions expire when the site's cookies expire. Re-run wc session to capture a fresh one:
wc session https://docs.example.com/login