Skip to content

Fix OLD (Oldham) scraper#439

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

Fix OLD (Oldham) scraper#439
symroe wants to merge 1 commit into
masterfrom
fix/OLD-scraper

Conversation

@symroe

@symroe symroe commented Jul 19, 2026

Copy link
Copy Markdown
Member

What broke

committees.oldham.gov.uk runs a WAF that rejects wreq's Firefox133 TLS fingerprint with a TCP connection reset. From Lambda, this manifests as a TCP connection timeout (harder block on Lambda's IP range). The ModGov ASMX endpoint is fully accessible to Python's standard OpenSSL TLS stack and to browser clients, but wreq's TLS client-hello is actively refused.

http_lib = "playwright" was tried first (Chromium headless TLS fingerprint) and also failed with net::ERR_CONNECTION_RESET, indicating this WAF blocks both Firefox133 and headless Chromium fingerprints but accepts Python's OpenSSL TLS stack.

What was fixed

  • councillors.py: added http_lib = "requests" — Python requests uses OpenSSL's standard TLS handshake which passes the WAF, and the ModGov ASMX endpoint returns plain XML with no JavaScript or interactive content that would require browser emulation.
  • verify_requests = False retained from the previous fix (self-signed/untrusted cert on this host).

Scrape results

Verified from live endpoint (committees.oldham.gov.uk/mgWebService.asmx/GetCouncillorsByWard):

Metric Count
Councillors found 60
With email address 60
With photo 60

Opened by LGSF maintenance bot (2026-07-19)


Generated by Claude Code

… block

committees.oldham.gov.uk's WAF rejects wreq's Firefox133 TLS fingerprint with
a connection reset. Python requests (OpenSSL TLS) is not blocked. The endpoint
is a plain XML API (ModGov ASMX) with no JavaScript or bot-detection that would
require browser emulation, so requests is appropriate here.

playwright was also tried and failed (Chromium headless TLS fingerprint also
rejected by this WAF), confirming requests as the correct fallback.
@symroe

symroe commented Jul 19, 2026

Copy link
Copy Markdown
Member Author

Re-scrape after 16b5c4c

Initial fix: added http_lib = "requests" to bypass WAF TLS fingerprint block on committees.oldham.gov.uk. Verified against live endpoint.

Metric Count
Councillors found 60
With email address 60
With photo 60

Photos are sourced from committees.oldham.gov.uk/UserData/*/bigpic.jpg (ModGov <photobigurl> in XML). Emails are nested under <workaddress><email> in the XML and picked up by the base class find("email") call.


Generated by LGSF maintenance bot (2026-07-19)


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