fix: address selection in Broxbourne Council#1873
fix: address selection in Broxbourne Council#1873teofanis wants to merge 1 commit intorobbrad:masterfrom
Conversation
📝 WalkthroughWalkthroughUpdates the BroxbourneCouncil web scraping module to use a more specific XPath for address selection and adds explicit clearing of the postcode input field before entering a new value, improving robustness of the address lookup flow. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). 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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1873 +/- ##
=======================================
Coverage 86.67% 86.67%
=======================================
Files 9 9
Lines 1141 1141
=======================================
Hits 989 989
Misses 152 152 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@uk_bin_collection/uk_bin_collection/councils/BroxbourneCouncil.py`:
- Around line 68-76: The code waits only for the <select> element before calling
Select(...).select_by_value(user_uprn), which can fail if options load
asynchronously; update BroxbourneCouncil.py to first wait for the option with
the desired UPRN to appear (e.g., use WebDriverWait +
EC.presence_of_element_located with an XPath like
"//label[normalize-space()='Choose
address']/following::select[1]/option[`@value`='{user_uprn}']"), then call
Select(address_select).select_by_value(user_uprn) so selection only occurs after
the option is present.
|
Can we merge this? |
|
Will be part of March release |
|
Adding to March release |
The addition
<select>elements shown above leak into our lookup and causeCannot locate option with value ...errors when we try to select the UPRN. This change makes the selector target theChoose addressdrop-down explicitly.Summary by CodeRabbit