fix: BostonBoroughCouncil - drive chosen.js widget for renamed ADDRESSUPRN select#1972
fix: BostonBoroughCouncil - drive chosen.js widget for renamed ADDRESSUPRN select#1972InertiaUK wants to merge 1 commit into
Conversation
…s select The V2 form renames the address field ID from BBCWASTECOLLECTIONSV2_ADDRESS_ADDRESSSELECTION to BBCWASTECOLLECTIONSV2_ADDRESS_ADDRESSUPRN. The old XPath no longer matches so the scraper times out waiting for the dropdown. Additionally, chosen.js hides the underlying <select>, so clicking an <option> inside it raises ElementNotInteractableException. Drive the chosen widget directly instead: open it, type into the search input to filter, then click the matching active-result li. Use contains(.,) rather than contains(text(),) because chosen wraps matched characters in <em> elements which breaks direct text() matching. Accept both old and new IDs so the scraper keeps working if Boston flips the rename back, and fall back to driving the native select via JS when no chosen container is present.
|
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 59 minutes and 26 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 (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. |
Problem
Boston's V2 collection form now uses
BBCWASTECOLLECTIONSV2_ADDRESS_ADDRESSUPRNfor the address select (wasADDRESSSELECTION), and wraps it in a chosen.js widget which hides the underlying<select>.Symptoms against live data:
XPath //select[contains(@id,'ADDRESSSELECTION')]never matches, triggeringTimeoutExceptionat the "Wait for the address dropdown" step.<option>inside it raisesElementNotInteractableException: Element is not currently visiblebecause chosen hides it.Live IDs captured after postcode search (PE20 1AY):
```
BBCWASTECOLLECTIONSV2_ADDRESS_ADDRESSUPRN (native ) BBCWASTECOLLECTIONSV2_ADDRESS_ADDRESSUPRN_chosen (chosen container) BBCWASTECOLLECTIONSV2_ADDRESS_ADDRESSUPRN_chosen_search_input BBCWASTECOLLECTIONSV2_ADDRESS_NEXT3_NEXT ``` Fix Wait on either ADDRESSUPRN or ADDRESSSELECTION so the scraper survives another flip. Drive the chosen widget directly: click it open, type the paon into chosen-search-input to filter, then click the matching active-result li. Use contains(., '...') instead of contains(text(), '...') because chosen wraps matched substrings in <em> elements, which breaks text() direct-child matching. Keep a JS fallback that sets the native <select>'s value and fires change / chosen:updated in case a future layout drops the chosen widget. Verification Fixture postcode PE20 1AY + paon CEDAR (from tests/input.json) now returns 3 bins: ``` Purple/Purple-lidded Paper/Card Bin 23/04/2026 Green Refuse Bin 30/04/2026 Blue Recycling Bin 07/05/2026 ``` Requires undetected-chromedriver / a CF-bypassing driver (site is Cloudflare-protected) — unchanged from prior behaviour.