fix: StocktonOnTeesCouncil - update form IDs to V2, dismiss cookie banner, fix test fixture#1954
fix: StocktonOnTeesCouncil - update form IDs to V2, dismiss cookie banner, fix test fixture#1954InertiaUK wants to merge 4 commits intorobbrad:masterfrom
Conversation
Torridge's SOAP API changed its response from explicit dates ("Mon 14 Apr")
to relative phrases ("Tomorrow then every Mon", "Today then every Tue")
with an embedded calendar table. The old regex-based parser returned empty
because it expected the old format.
The rewritten parser handles Today/Tomorrow/weekday-name phrases, falls back
to the old explicit format if it reappears, and gracefully skips "No X
collection for this address" entries.
The Wyre bin collection page now includes a 'Download calendar' box among the .boxed divs. This box has no h3.bin-collection-tasks__heading, which caused the scraper to crash on .text access. Changes: - Skip boxes missing the heading or content container - Use regex to extract the bin name from 'Your next X collection' - Collapse whitespace on the date text before strptime (p tags produced multi-whitespace runs after .text) - Roll year forward only when the computed date is in the past, instead of only handling the December->January edge case
…e results The checkyourbinday page is now: - Gated by Cloudflare Turnstile (requires non-headless UC) - Using WASTECOLLECTIONCALENDARV7_* element IDs (was V5) - Rendering collection dates inline as .gi-summary-blocklist__row divs after address selection — no separate NEXT/submit step Changes: - Update all element IDs from V5 to V7 - Add Cloudflare challenge wait loop (up to 50s) - Dismiss cookie consent before interaction (was blocking button clicks) - Replace old table-based parsing with .gi-summary-blocklist__row scraping - Use Select.select_by_visible_text with stale-retry instead of manual option.click() loop (which crashed on AJAX re-renders) - Remove the smart_select_address helper's dead fuzzy/strict split
…anner Stockton's AchieveForms form name changed from LOOKUPBINDATESBYADDRESSSKIPOUTOFREGION to LOOKUPBINDATESBYADDRESSSKIPOUTOFREGIONV2, so every element ID needed the V2 suffix added. Also added a cookie-banner dismissal step — the banner was covering the search button and intercepting clicks.
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 28 minutes and 45 seconds. ⌛ 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 (5)
✨ 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 |
What this changes
Stockton's AchieveForms form name has been renamed from
LOOKUPBINDATESBYADDRESSSKIPOUTOFREGION_*toLOOKUPBINDATESBYADDRESSSKIPOUTOFREGIONV2_*. Every element ID the scraper looks up needs theV2suffix, so the postcode input is no longer found and the scraper times out on the firstWebDriverWait.Additionally, the cookie consent banner has started covering the search button on fresh sessions, and
send_keys(ENTER)was silently intercepted by the overlay.Changes
LOOKUPBINDATESBYADDRESSSKIPOUTOFREGION_->LOOKUPBINDATESBYADDRESSSKIPOUTOFREGIONV2_across all element IDs (postcode input, search button, address dropdown, results panel).driver.get— matches the pattern used in other AchieveForms councils.input.json:postcode:TS20 2RD->TS19 0RFhouse_number:24->1(1 Bishopton Avenue)url:https://www.stockton.gov.uk->https://www.stockton.gov.uk/bin-collection-daysThe old fixture's
TS20 2RD #24returns no match in the current dropdown (probably due to an address refresh on Stockton's side), so the CI would still fail even with correct element IDs.TS19 0RF #1is a real residential property in Norton that comes back with three active bins.Test
Verified with the VPS UC wrapper: