From 708939b0811cb5fb6eedce37d454ce5c919fe32e Mon Sep 17 00:00:00 2001 From: m26dvd <31007572+m26dvd@users.noreply.github.com> Date: Thu, 31 Oct 2024 02:29:44 +0000 Subject: [PATCH] fix: Croydon Council --- .../uk_bin_collection/councils/CroydonCouncil.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/uk_bin_collection/uk_bin_collection/councils/CroydonCouncil.py b/uk_bin_collection/uk_bin_collection/councils/CroydonCouncil.py index 4dd32b7306..d866cfe4a6 100644 --- a/uk_bin_collection/uk_bin_collection/councils/CroydonCouncil.py +++ b/uk_bin_collection/uk_bin_collection/councils/CroydonCouncil.py @@ -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)