Skip to content

Commit

Permalink
fix: ForestOfDeanDistrictCouncil
Browse files Browse the repository at this point in the history
  • Loading branch information
m26dvd committed Oct 31, 2024
1 parent 708939b commit d461798
Showing 1 changed file with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,16 @@ def parse_data(self, page: str, **kwargs) -> dict:
columns = row.find_all("td")
if columns:
container_type = row.find("th").text.strip()
collection_day = re.sub(
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"
)
else:
collection_day = re.sub(
r"[^a-zA-Z0-9,\s]", "", columns[0].get_text()
).strip()

# Parse the date from the string
parsed_date = datetime.strptime(collection_day, "%a, %d %B")
Expand Down

0 comments on commit d461798

Please sign in to comment.