Fix BRY (Bromley) scraper - #507
Open
symroe wants to merge 1 commit into
Open
Conversation
…timeout The previous fix (PR #277) switched from rnet to requests to bypass an X509 certificate chain rejection. The requests lib worked at the time but cds.bromley.gov.uk now returns a 30-second read timeout under Lambda for plain requests traffic, suggesting server-side bot detection or rate limiting on non-browser user-agents. Switch to playwright so the scraper uses Chromium's browser fingerprint, which typically bypasses WAF/bot detection that would tarpit requests.
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
PR #277 fixed a previous failure by switching
http_libfrom rnet (wreq) torequeststo bypass an X509 certificate chain rejection oncds.bromley.gov.uk. That resolved the SSL issue, but the scraper is now failing again with a 30-second read timeout: the SSL connection is established and the TLS handshake completes, but the server never sends an HTTP response within the timeout window. This pattern is consistent with server-side bot detection or rate limiting that tarpits non-browser traffic.What was fixed
http_lib = "requests"tohttp_lib = "playwright"so the scraper uses Chromium's browser fingerprint, which bypasses WAF/bot detection that stalls plainrequeststrafficScrape results
Unable to verify locally —
cds.bromley.gov.ukis unreachable from the Lambda-equivalent dev environment (same network restriction that causes the production failure). The previous successful run (PR #277) recorded:Generated by Claude Code