From 8e2aaafd25a81ab11415fea45d5cb31accfc8c16 Mon Sep 17 00:00:00 2001 From: m26dvd <31007572+m26dvd@users.noreply.github.com> Date: Thu, 31 Oct 2024 02:50:31 +0000 Subject: [PATCH] fix: WestOxfordshireDistrictCouncil --- .../councils/WestOxfordshireDistrictCouncil.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/uk_bin_collection/uk_bin_collection/councils/WestOxfordshireDistrictCouncil.py b/uk_bin_collection/uk_bin_collection/councils/WestOxfordshireDistrictCouncil.py index e6439c4c34..99b39edbd7 100644 --- a/uk_bin_collection/uk_bin_collection/councils/WestOxfordshireDistrictCouncil.py +++ b/uk_bin_collection/uk_bin_collection/councils/WestOxfordshireDistrictCouncil.py @@ -86,6 +86,13 @@ def parse_data(self, page: str, **kwargs) -> dict: r"[^a-zA-Z0-9,\s]", "", columns[0].get_text() ).strip() + if columns[0].get_text() == "Today": + collection_day = datetime.now().strftime("%a, %d %B") + elif columns[0].get_text() == "Tomorrow": + collection_day = (datetime.now() + timedelta(days=1)).strftime( + "%a, %d %B" + ) + # Parse the date from the string parsed_date = datetime.strptime(collection_day, "%a, %d %B") if parsed_date < datetime(