diff --git a/CLAUDE.md b/CLAUDE.md index 42e79383..8c98d998 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -99,6 +99,112 @@ Bump `wordpress-plugin/VERSION` on changes: --- +## Puppeteer Scraping (Browser-Based) + +### Age Gate Bypass + +Most dispensary sites require age verification. The browser scraper handles this automatically: + +**Utility File**: `src/utils/age-gate.ts` + +**Key Functions**: +- `setAgeGateCookies(page, url, state)` - Set cookies BEFORE navigation to prevent gate +- `hasAgeGate(page)` - Detect if page shows age verification +- `bypassAgeGate(page, state)` - Click through age gate if displayed +- `detectStateFromUrl(url)` - Extract state from URL (e.g., `-az-` → Arizona) + +**Cookie Names Set**: +- `age_gate_passed: 'true'` +- `selected_state: ''` +- `age_verified: 'true'` + +**Bypass Methods** (tried in order): +1. Custom dropdown (shadcn/radix style) - Curaleaf pattern +2. Standard `