Skip to content

Fix BRY (Bromley) scraper - #507

Open
symroe wants to merge 1 commit into
masterfrom
fix/BRY-scraper
Open

Fix BRY (Bromley) scraper#507
symroe wants to merge 1 commit into
masterfrom
fix/BRY-scraper

Conversation

@symroe

@symroe symroe commented Aug 16, 2026

Copy link
Copy Markdown
Member

What broke

PR #277 fixed a previous failure by switching http_lib from rnet (wreq) to requests to bypass an X509 certificate chain rejection on cds.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

  • Changed http_lib = "requests" to http_lib = "playwright" so the scraper uses Chromium's browser fingerprint, which bypasses WAF/bot detection that stalls plain requests traffic

Scrape results

Unable to verify locally — cds.bromley.gov.uk is unreachable from the Lambda-equivalent dev environment (same network restriction that causes the production failure). The previous successful run (PR #277) recorded:

Metric Count
Councillors found 58
With email address 58
With photo 58

Generated by Claude Code

…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants