Fix TAM (Tameside) scraper - #489
Open
symroe wants to merge 1 commit into
Open
Conversation
… bypass tameside.moderngov.co.uk now has Cloudflare Bot Management in front of it. wreq gets 403 Forbidden on both HTTP and HTTPS. Switching base_url to HTTPS and adding http_lib = "playwright" lets headless Chromium solve the JS challenge — the same pattern used in PR #407 (BPC) and PRs #472–#488.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What broke
tameside.moderngov.co.uknow has Cloudflare Bot Management in front of it. When wreq (the Haskell HTTP client) requestshttp://tameside.moderngov.co.uk/mgWebService.asmx/GetCouncillorsByWard, Cloudflare returns 403 Forbidden rather than the XML data. The same block applies on HTTPS, and the council has been failing for 4 consecutive runs (since 2026-07-31).What was fixed
base_urlinmetadata.jsonfromhttp://tohttps://— Cloudflare enforces HTTPS on this domainhttp_lib = "playwright"tocouncillors.py— headless Chromium solves the Cloudflare JS challenge and fetches the ASMX XML endpoint. This is the same pattern used in PR Fix BPC (Bournemouth, Christchurch and Poole) scraper #407 (BPC) for Cloudflare-protected ModernGov instances and in PRs Fix BNS (Barnsley) scraper #472–Fix MSU (Mid Suffolk) scraper #488 for other councils with the same failure mode.Scrape results
Local verification was not possible in this run — the network proxy used in this environment blocks Chromium's TLS connections, causing connection resets when playwright tries to navigate to
*.moderngov.co.uk. The fix is structurally identical to the fix applied in PR #407 (Bournemouth, Christchurch and Poole) which was merged and verified in Lambda. Scrape counts will be confirmed once CI runs in Lambda.Generated by Claude Code