Skip to content

Commit b81eaf5

Browse files
committed
fix: date extraction in RochfordCouncil data parsing
1 parent f015140 commit b81eaf5

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

uk_bin_collection/uk_bin_collection/councils/RochfordCouncil.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,9 @@ def parse_data(self, page: str, **kwargs) -> dict:
3333
"tr", {"class": "govuk-table__row"}
3434
):
3535
week_text = week.get_text().strip().split("\n")
36+
date_str = week_text[0].split(" - ")[0].split("–")[0].strip()
3637
collection_date = datetime.strptime(
37-
remove_ordinal_indicator_from_date_string(
38-
week_text[0].split(" - ")[0]
39-
)
40-
.strip(),
38+
remove_ordinal_indicator_from_date_string(date_str),
4139
"%A %d %B",
4240
)
4341
next_collection = collection_date.replace(year=datetime.now().year)

0 commit comments

Comments
 (0)