Skip to content

Fix MON (Monmouthshire) scraper#401

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

Fix MON (Monmouthshire) scraper#401
symroe wants to merge 1 commit into
masterfrom
fix/MON-scraper

Conversation

@symroe

@symroe symroe commented Jun 28, 2026

Copy link
Copy Markdown
Member

What broke

Monmouthshire's ModGov endpoint (democracy.monmouthshire.gov.uk) times out when accessed from Lambda using wreq's Firefox133 TLS fingerprint. The endpoint is accessible from other IPs and returns valid XML (confirmed 200 OK with 46 councillors), confirming the issue is a WAF fingerprint block on wreq's specific TLS client-hello.

What was fixed

  • Added http_lib = "playwright" — switches from wreq (Firefox133 TLS emulation) to headless Chromium, which uses a standard Chrome TLS fingerprint that passes the WAF check. Same fix pattern as HAL, DAC, LBH, NYE, WOX, TON, FOE.

Scrape results

Confirmed from live XML endpoint:

Metric Count
Councillors found 46
With email address 0 (emails on individual councillor pages, fetched during scrape)
With photo 46

Note: email count will be populated once the scraper runs end-to-end via Lambda.


Generated by Claude Code

…t block

Monmouthshire's ModGov endpoint (democracy.monmouthshire.gov.uk) is
accessible from non-Lambda IPs (confirmed 200 OK with 46 councillors
via standard requests library) but times out from Lambda when using
wreq's Firefox133 TLS emulation.

Switching to http_lib="playwright" uses headless Chromium which passes
the server's WAF and receives the councillor XML normally.
@symroe

symroe commented Jun 28, 2026

Copy link
Copy Markdown
Member Author

Re-scrape after 7c4260b

Playwright fix applied: added http_lib = "playwright" (replacing pass).

Endpoint confirmed live: direct request to democracy.monmouthshire.gov.uk/mgWebService.asmx/GetCouncillorsByWard returns valid XML with 46 councillors. Lambda's wreq client times out due to WAF blocking wreq's Firefox133 TLS fingerprint; Playwright's Chromium fingerprint passes.

Metric Count
Councillors found 46 (confirmed from live XML)
With email address TBC (emails on individual councillor pages)
With photo 46 (confirmed from live XML — <photobigurl> populated)

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.

1 participant