robbrad / UKBinCollectionData

UK Council Bin Collection Data Parser Outputting Bin Data as a JSON
MIT License
105 stars 73 forks source link

Huntingdon District Council no longer working #684

Closed jamescra closed 2 months ago

jamescra commented 2 months ago

Name of Council

Huntingdon District Council

Issue Information

The lookup of collections for Huntingdon District Council no longer functions correctly. I suspect this might be as they have just moved 'Organic Waste' to a new pay for service and so the layout of the page is slightly different now.

Logfile shows: Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 315, in _async_refresh self.data = await self._async_update_data() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/uk_bin_collection/sensor.py", line 133, in _async_update_data data = await self.hass.async_add_executor_job(self.ukbcd.run) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/uk_bin_collection/uk_bin_collection/collect_data.py", line 96, in run return self.client_code( ^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/uk_bin_collection/uk_bin_collection/collect_data.py", line 115, in client_code return get_bin_data_class.template_method(address_url, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/uk_bin_collection/uk_bin_collection/get_bin_data.py", line 66, in template_method bin_data_dict = self.parse_data( ^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/uk_bin_collection/uk_bin_collection/councils/HuntingdonDistrictCouncil.py", line 32, in parse_data "collectionDate": datetime.strptime(date.find("strong").get_text(strip=True), "%A %d %B %Y").strftime(date_format) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'get_text' 2024-04-22 14:36:15.382 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up uk_bin_collection platform for sensor

URL showing collection data is https://www.huntingdonshire.gov.uk/refuse-calendar/100090109259

Verification

ELKER54 commented 2 months ago

I also have this issue, did you manage to get it working at all?