Skip to content

Fix MDW (Medway) scraper#428

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

Fix MDW (Medway) scraper#428
symroe wants to merge 1 commit into
masterfrom
fix/MDW-scraper

Conversation

@symroe

@symroe symroe commented Jul 10, 2026

Copy link
Copy Markdown
Member

What broke

democracy.medway.gov.uk times out from Lambda with wreq's Firefox133 TLS fingerprint — TCP connection timed out after 110 seconds. The existing verify_requests = False addresses a certificate trust issue on this host but does not bypass the WAF's TLS fingerprint check: the WAF drops the connection during the TLS handshake when it detects wreq's Firefox client-hello, causing a connection timeout. The ModGov XML endpoint is accessible from non-Lambda clients. Same WAF fingerprint block pattern as HNS (#405), LAC (#420), DAC (#416), and other recently fixed ModGov instances.

What was fixed

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

Scrape results

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

Generated by Claude Code

democracy.medway.gov.uk times out from Lambda with wreq's Firefox133 TLS
fingerprint. The existing verify_requests=False addresses a certificate issue
but does not bypass the WAF's TLS fingerprint check, which drops the
connection before any HTTP response is returned. Adding http_lib="playwright"
switches to headless Chromium's Chrome TLS fingerprint, which passes the WAF
and allows the ModGov XML endpoint to be reached. Same fix pattern as HNS
(#405), LAC (#420), DAC (#416), and other recently fixed ModGov instances.
@symroe

symroe commented Jul 10, 2026

Copy link
Copy Markdown
Member Author

Re-scrape after 9f85123

Initial PR — added http_lib = "playwright" and retained verify_requests = False. The WAF blocks all non-Chromium clients from this environment (TCP connection timed out after 110 seconds), so a full end-to-end count requires a Lambda run.

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