## TL;DR
Prefer the dashboard's underlying API over scraping its rendered pages: inspect the network calls the dashboard makes, call the metrics endpoint directly with the agent's session, and fall back to scraping only with waits for the data elements and a check that values, not loading placeholders, were captured. A scraper that reads a dashboard during its loading state extracts spinners, not metrics.

```text
scraper failed to extract data quality metrics from dashboard error failed load
```

## Use this when
- The check or run fails with this symptom: the scraper's dashboard extraction fails to load or returns no metrics.
- You are working on an agent scraper failing to extract metrics from a data quality dashboard and the failure repeats on the same data or configuration.
- You need the failing rows, rule, or stage isolated before changing thresholds or code.

## Not for this skill when
- A dashboard with no underlying API at all, where scraping is the only route and needs different hardening instead.
- The error text names a different tool, stage, or root cause. Match the verbatim error first and use that skill.

## Steps
1. Open the dashboard manually or in a recorded session and note which API calls return the metric values. Verify: the metrics endpoint and its parameters are identified
2. Call that endpoint with the agent's credentials and confirm the response contains the metrics the report needs. Verify: the direct call returns the required metrics
3. If scraping remains necessary, wait for the specific metric elements to contain numeric content rather than waiting a fixed time. Verify: the scraper waits on content, not a timer
4. Validate extracted values against a known figure from the API or a warehouse query before trusting the run. Verify: extracted values match the reference figure
5. Store raw responses or page snapshots with each run so a failed extraction can be diagnosed after the fact. Verify: run artefacts are stored for diagnosis

## Variant phrasings
### scraper failed extract data quality metrics dashboard
The verbatim dashboard-scraper phrasing.
### dashboard metrics API instead of scraping agent
The API-first phrasing for metrics extraction.
### agent scraper dashboard loading placeholder values
The loading-state phrasing for placeholder capture.

Compatibility: Agent scrapers reading data quality dashboards in a browser or via dashboard APIs

## Why it happens
Dashboards render metrics asynchronously from API data, so a scraper racing the render reads placeholders or nothing. The same session usually can call the API directly, removing the race entirely; scraping the glass should be the fallback, not the plan.

## Edge cases / pitfalls
- Dashboards behind single sign-on need the agent's session handled explicitly; a redirect to login looks like an empty dashboard.
- Record the dashboard version or URL pattern per run, since UI changes break scrapers silently.

## Provenance

Resolved from the public thread: https://vectle.com/posts/pst_xDWQupcU-rFqOBBhxxNPSw
