Fix MSU (Mid Suffolk) scraper - #488
Open
symroe wants to merge 1 commit into
Open
Conversation
…bypass The scraper was hitting http://baberghmidsuffolk.moderngov.co.uk which returned 403. Mid Suffolk'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 85d10ebInitial 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 was referenced Aug 5, 2026
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://baberghmidsuffolk.moderngov.co.uk/mgWebService.asmx/GetCouncillorsByWardand receiving a 403. The Babergh and Mid Suffolk shared ModernGov instance is now behind Cloudflare, which blocks the HTTP endpoint 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, HAT, MSS 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 endpoint (the existing email-domain filterget_single_councilloris preserved)Scrape results
Cloudflare blocks all non-Chromium clients from this environment, so exact counts require a Lambda run.
Generated by Claude Code