From 6452eb1e583a5a1560fc9d61764d45bb8bc29c6c Mon Sep 17 00:00:00 2001 From: Chris Stos-Gale Date: Wed, 23 Apr 2025 10:13:44 +0100 Subject: [PATCH] Fix: #1359 - HTML Parsing error with Harrogate Borough Council The first table has now been re-added, so I have changed the code to look for the last table irrespective of how many tables there are, so it will always find the right one. --- .../uk_bin_collection/councils/HarrogateBoroughCouncil.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/uk_bin_collection/uk_bin_collection/councils/HarrogateBoroughCouncil.py b/uk_bin_collection/uk_bin_collection/councils/HarrogateBoroughCouncil.py index 180d784f68..25912272eb 100644 --- a/uk_bin_collection/uk_bin_collection/councils/HarrogateBoroughCouncil.py +++ b/uk_bin_collection/uk_bin_collection/councils/HarrogateBoroughCouncil.py @@ -37,7 +37,7 @@ def parse_data(self, page: str, **kwargs) -> dict: collections = [] # Find section with bins in - table = soup.find_all("table", {"class": "hbcRounds"})[0] + table = soup.find_all("table", {"class": "hbcRounds"})[-1] # For each bin section, get the text and the list elements for row in table.find_all("tr"):