Skip to content

Commit

Permalink
Correcting source date format handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Leigh committed Jul 8, 2024
1 parent 51488d5 commit 13536b2
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,11 @@ def fetch(self):
"next": "Next",
}

collection_response = session.post(API_URLS["collection"], data=form_data)
collection_response = session.post(
API_URLS["collection"], data=form_data)

collection_soup = BeautifulSoup(collection_response.text, "html.parser")
collection_soup = BeautifulSoup(
collection_response.text, "html.parser")
tr = collection_soup.findAll("tr")

# The council API returns no year for the collections
Expand All @@ -81,7 +83,7 @@ def fetch(self):
try:
# Broxbourne give an empty date field where there is no collection
collection_date = datetime.datetime.strptime(
collection_date_text, "%a %d %B %Y"
collection_date_text, "%a %d %b %Y"
).date()

except ValueError as e:
Expand Down

0 comments on commit 13536b2

Please sign in to comment.