From 7eac857d576321ac867844472ee241e8f566bf9e Mon Sep 17 00:00:00 2001 From: 5ila5 <5ila5@users.noreply.github.com> Date: Mon, 30 Sep 2024 12:52:39 +0200 Subject: [PATCH] fix stirling_uk --- .../waste_collection_schedule/source/stirling_uk.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/custom_components/waste_collection_schedule/waste_collection_schedule/source/stirling_uk.py b/custom_components/waste_collection_schedule/waste_collection_schedule/source/stirling_uk.py index 300c542d8..26ca421a4 100644 --- a/custom_components/waste_collection_schedule/waste_collection_schedule/source/stirling_uk.py +++ b/custom_components/waste_collection_schedule/waste_collection_schedule/source/stirling_uk.py @@ -57,6 +57,8 @@ def fetch(self): for item in scheduleItems: BinType = item.find("h2", class_="schedule__title") NextCollection = item.find("p", class_="schedule__summary") + if not NextCollection: + continue # bin_type_text = BinType.text.strip() # next_collection_text = NextCollection.text.strip().split(REM_STRING1, 1)[0].strip() # date_object = datetime.strptime(next_collection_text, "%A %d %b %Y")