fix: ChelmsfordCityCouncil - replace Selenium with requests (emarsys popup blocks clicks)#1984
Conversation
…emarsys popup timeout The council page now shows an emarsys popup modal (z-index 2147483647) on first load that intercepts Selenium clicks, causing 30s WebDriverWait timeouts on both the cookie banner and the results table, blowing past the 90s test limit. The search form submits via GET querystring (?<block_id>_keyword=<postcode>) and the results table renders in static HTML. Replace the entire Selenium flow with requests + BeautifulSoup: discover the dynamic block ID from the search page, submit via querystring, parse the results table to find the collection round, fetch the calendar page, download and parse the .ics file. No browser required. Wall time: ~2.5s.
|
Warning Rate limit exceeded
To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Included in May 2026 Release PR #1992. Closing. |
…equests (supersedes robbrad#1973)
What
Replaces the Selenium-based scraper with a pure
requests+BeautifulSoupimplementation. Wall time drops from 90s+ (timeout) to ~2.5s.Root cause
The council page now displays an emarsys popup modal (
z-index: 2147483647) on first load that covers the entire viewport. Selenium'selement_to_be_clickablereports the cookie ACCEPT button as clickable (it's in the DOM), but.click()raisesElementClickInterceptedExceptionwhich the broadexceptswallows silently. The popup stays up, the postcode input is then uninteractable, and both subsequentWebDriverWait(30s)calls time out — blowing past the 90s test limit.Fix
The search form submits via GET querystring (
?<block_id>_keyword=<postcode>) and the address table, collection round text, and calendar page all render in static HTML. No browser interaction needed:<input id="NNNN_keyword">element?NNNN_keyword=<postcode>→ parse the results table row matchingpaon→ extract collection round (e.g.Tuesday B).icslinkA fallback
<details>card path handles any future page structure changes.Test
Tested against postcode
CM3 7AE, paon1 Celeborn Street, South Woodham Ferrers, Chelmsford, CM3 7AE. Returns 36 bin entries (food waste, black bin, green box, card sack / brown bin, plastics and cartons, paper sack) spanning ~60 days.Input.json
house_number(used aspaon) andpostcodefields are unchanged.web_driverkey is now unused but harmless.