Skip to content

Commit

Permalink
fix: Croydon Council
Browse files Browse the repository at this point in the history
  • Loading branch information
m26dvd committed Oct 31, 2024
1 parent 1287dc8 commit 708939b
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions uk_bin_collection/uk_bin_collection/councils/CroydonCouncil.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,18 +267,12 @@ def parse_data(self, page: str, **kwargs) -> dict:
data = {"bins": []}

for e in collection_record_elements:
collection_type = e.find_all(
"div", {"class": "fragment_presenter_template_show"}
)[0].text.strip()
collection_date = (
e.find("div", {"class": "bin-collection-next"})
.attrs["data-current_value"]
.strip()
)
collection_type = e.find("h2").get_text()
collection_date = e.find("span", {"class": "value-as-text"}).get_text()
dict_data = {
"type": collection_type,
"collectionDate": datetime.strptime(
collection_date, "%d/%m/%Y %H:%M"
collection_date, "%A %d %B %Y"
).strftime(date_format),
}
data["bins"].append(dict_data)
Expand Down

0 comments on commit 708939b

Please sign in to comment.