Fix HAT (Hart) scraper - #486
Open
symroe wants to merge 1 commit into
Open
Conversation
The scraper was hitting http://hart.moderngov.co.uk which returned 403. Hart's ModernGov instance is now behind Cloudflare and requires both HTTPS and a browser-level JS challenge to access the ASMX web service endpoint. - Migrate base_url from http:// to https:// - Add http_lib = "playwright" to execute Cloudflare JS challenge via headless Chromium
Member
Author
Re-scrape after 34381e8Initial fix: HTTPS migration + Playwright for Cloudflare bypass. Cloudflare blocks all non-Chromium clients from this environment, so scrape counts can only be confirmed after a Lambda run.
Generated by Claude Code |
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
The scraper was requesting
http://hart.moderngov.co.uk/mgWebService.asmx/GetCouncillorsByWardand receiving a 403. Hart District Council's ModernGov instance is now behind Cloudflare, which blocks HTTP entirely and serves a Cloudflare challenge page on HTTPS when accessed with a non-browser TLS fingerprint. Same failure pattern as BNS, BRW, CHI, CHS, HAS and other recently affected ModernGov councils.What was fixed
metadata.json: migratedbase_urlfromhttp://tohttps://councillors.py: addedhttp_lib = "playwright"so headless Chromium executes the Cloudflare JS challenge before fetching the ModGov ASMX XML endpointScrape results
Cloudflare blocks all non-Chromium clients from this environment, so exact counts require a Lambda run.
Generated by Claude Code