Skip to content

Commit

Permalink
fix: #771 Bolton bullet points on dates is now fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
robbrad committed Aug 8, 2024
1 parent 2b81b75 commit 381dceb
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import time
import re

from datetime import datetime

from bs4 import BeautifulSoup
Expand Down Expand Up @@ -80,7 +82,8 @@ def parse_data(self, page: str, **kwargs) -> dict:
bin_type = " ".join(words).capitalize()
date_list = item.find_all("p")
for d in date_list:
next_collection = datetime.strptime(d.text.strip(), "%A %d %B %Y")
clean_date_str = re.sub(r'[^A-Za-z0-9 ]+', '', d.text.strip())
next_collection = datetime.strptime(clean_date_str, "%A %d %B %Y")
collections.append((bin_type, next_collection))

# Sort the text and list elements by date
Expand Down

0 comments on commit 381dceb

Please sign in to comment.