Skip to content

Commit

Permalink
Merge pull request #662 from dp247/654-broxtowe-borough-council-stopp…
Browse files Browse the repository at this point in the history
…ed-working

Fix: #654 - Broxtowe Borough Council parsing error
  • Loading branch information
robbrad authored Apr 15, 2024
2 parents 264ba5a + e4e672c commit f0ec420
Showing 1 changed file with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,15 @@ def parse_data(self, page: str, **kwargs) -> dict:
bin_type = cells[0].get_text(strip=True)
# Skip header row
if bin_type and cells[3] and bin_type != "Bin Type":
collection_date = datetime.strptime(
cells[3].get_text(strip=True), "%A, %d %B %Y"
)
dict_data = {
"type": bin_type,
"collectionDate": collection_date.strftime(date_format),
}
data["bins"].append(dict_data)
if len(cells[3].get_text(strip=True)) > 0:
collection_date = datetime.strptime(
cells[3].get_text(strip=True), "%A, %d %B %Y"
)
dict_data = {
"type": bin_type,
"collectionDate": collection_date.strftime(date_format),
}
data["bins"].append(dict_data)

data["bins"].sort(
key=lambda x: datetime.strptime(
Expand Down

0 comments on commit f0ec420

Please sign in to comment.