From b72faca9ce84791ae076ca0e24a4bdb5e0f8ecad Mon Sep 17 00:00:00 2001 From: m26dvd <31007572+m26dvd@users.noreply.github.com> Date: Thu, 12 Dec 2024 23:36:26 +0000 Subject: [PATCH] fix: London Borough Sutton fix: #1076 (cherry picked from commit 1eab20c9a57c9c4438ea343f374202bb2e9b98ca) --- .../councils/LondonBoroughSutton.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/uk_bin_collection/uk_bin_collection/councils/LondonBoroughSutton.py b/uk_bin_collection/uk_bin_collection/councils/LondonBoroughSutton.py index 9571a27c12..8537e1ac32 100644 --- a/uk_bin_collection/uk_bin_collection/councils/LondonBoroughSutton.py +++ b/uk_bin_collection/uk_bin_collection/councils/LondonBoroughSutton.py @@ -42,14 +42,18 @@ def parse_data(self, page: str, **kwargs) -> dict: bin_type = service.get_text( strip=True ) # Bin type name (e.g., 'Food waste', 'Mixed recycling') - if bin_type == "Bulky waste": + if bin_type == "Bulky Waste": continue service_details = service.find_next("div", class_="govuk-grid-row") next_collection = ( - service_details.find("dt", string="Next collection") - .find_next_sibling("dd") - .get_text(strip=True) + ( + service_details.find("dt", string="Next collection") + .find_next_sibling("dd") + .get_text(strip=True) + ) + .replace("(this collection has been adjusted from its usual time)", "") + .strip() ) next_collection = datetime.strptime(