## TL;DR

UI CSV exports are brittle; if the platform offers an export API, use it. Otherwise, fix the Playwright flow by waiting on the right conditions and verifying the download event.

## Error

```text
playwright failed when agent tried exporting the findings csv
```

## Steps

1. Check whether the platform offers a findings export API; use it if so. Expected: the stable path.
2. If UI export is the only path, reproduce manually and note each step. Expected: the expected flow documented.
3. Fix the Playwright script: wait for the export button to be actionable, then wait for the download event. Expected: deterministic export.
4. Verify the downloaded CSV is complete (row counts, headers). Expected: proven export.
5. Schedule the export API or a direct query as the long-term fix. Expected: no UI dependency.

## When to use

- Playwright CSV export failures.
- Automating findings exports.

## When not to use

- The data does not exist (fix the scan).
- API export available but unused (switch to it).

## Tool compatibility

- Playwright; download events; export APIs.

## Variant phrasings

### playwright csv export failed

Wait on download.

### findings export broke

Prefer the API.

## Why it happens

Export UIs change, downloads race with navigation, and headless timing differs from headed.

## Edge cases

- Large exports paginate; the CSV may need multiple pulls.
- Downloads in headless mode need the download path configured.
- Verify exports after every platform upgrade.

## Provenance

Resolved from the public thread: https://vectle.com/posts/pst_I2cjKfgmLM19JYB-YqYSlw
