Fix ABE (Aberdeen City) scraper#423
Open
symroe wants to merge 1 commit into
Open
Conversation
…bypass aberdeen.moderngov.co.uk times out from Lambda when accessed via wreq's Firefox133 TLS fingerprint. The ModGov XML endpoint returns valid data to non-Lambda clients (confirmed: 44 councillors in GetCouncillorsByWard response), confirming the issue is a WAF dropping the TLS handshake on wreq's client-hello. Playwright's Chrome fingerprint bypasses the WAF. The existing verify_requests=False (for the certificate trust issue) is retained as it is independent of the WAF fingerprint block. The timeout=30 override is removed — it was redundant with wreq's default and is not applicable to playwright, which manages its own timeouts.
Member
Author
Re-scrape after aebd5f2Added ModGov XML endpoint confirmed returning valid data from non-Lambda environment:
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
aberdeen.moderngov.co.uktimes out from Lambda when accessed with wreq's Firefox133 TLS fingerprint. The ModGov endpoint returns valid councillor data to non-Lambda clients (confirmed:GET /mgWebService.asmx/GetCouncillorsByWardreturns HTTP 200 with full XML — councillors across all wards, photos and party affiliations present). The timeout is a WAF dropping the TLS handshake on wreq's Firefox client-hello before any HTTP response is sent. Same pattern as other recently fixed councils (HNS #405, DAC #416, LAC #420, FLN #421).The existing
verify_requests = False(from PR #316, for a certificate trust issue on this host) is independent of the WAF fingerprint block and is retained. Thetimeout = 30override is removed — it was redundant with wreq's default and has no effect on playwright.What was fixed
councillors.py: addedhttp_lib = "playwright"— headless Chromium's Chrome TLS fingerprint passes the WAFcouncillors.py: removedtimeout = 30— inapplicable to playwright and redundant under wreqScrape results
Generated by Claude Code