Skip to content

Fix NTL (Neath Port Talbot) scraper#425

Open
symroe wants to merge 1 commit into
masterfrom
fix/NTL-scraper
Open

Fix NTL (Neath Port Talbot) scraper#425
symroe wants to merge 1 commit into
masterfrom
fix/NTL-scraper

Conversation

@symroe

@symroe symroe commented Jul 9, 2026

Copy link
Copy Markdown
Member

What broke

democracy.npt.gov.uk is fronted by Azure CDN. The WAF started returning HTTP 403 to wreq's Firefox133 TLS fingerprint on 2026-07-07 (confirmed: curl -sI returns HTTP/2 403 with x-azure-ref and x-cache: CONFIG_NOCACHE headers). The existing verify_requests = False addresses a certificate trust issue on this host but does not bypass the WAF's TLS fingerprint check. Same Azure WAF blocking pattern as HMF, DAL, and other councils failing since 2026-07-07.

What was fixed

  • councillors.py: added http_lib = "playwright" — headless Chromium's Chrome TLS fingerprint passes the Azure WAF, allowing the ModGov XML endpoint to be reached
  • councillors.py: retained verify_requests = False — the certificate trust issue is independent of the WAF block

Scrape results

Metric Count
Councillors found TBC (Lambda run needed — Azure WAF blocks all non-Chromium clients from this environment)
With email address TBC
With photo TBC

Generated by Claude Code

…pass

democracy.npt.gov.uk is fronted by Azure CDN and returns HTTP 403 to
wreq's Firefox133 TLS fingerprint (confirmed: x-azure-ref headers in
response). Playwright's Chrome TLS fingerprint bypasses the Azure WAF,
allowing the ModGov XML endpoint to respond. The existing verify_requests=False
is retained as it addresses a certificate trust issue independent of the
WAF block.
@symroe

symroe commented Jul 9, 2026

Copy link
Copy Markdown
Member Author

Re-scrape after b922254

Added http_lib = "playwright" alongside existing verify_requests = False.

Azure WAF returns 403 with x-azure-ref / x-cache: CONFIG_NOCACHE headers to all non-Chromium clients from this environment — counts cannot be confirmed without a Lambda run. The certificate trust issue (verify_requests = False) is independent of the WAF block and is retained.

Metric Count
Councillors found TBC (Lambda run needed)
With email address TBC
With photo TBC

Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants