Skip to content

Commit 5875c7b

Browse files
committed
fix: Eastleigh date fix
1 parent 829f759 commit 5875c7b

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

uk_bin_collection/uk_bin_collection/councils/EastleighBoroughCouncil.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,13 @@ def parse_data(self, page: str, **kwargs) -> dict:
7777
return data
7878

7979
except Exception as e:
80-
print(f"Error fetching/parsing data: {str(e)}")
81-
return {"bins": [{"type": "Error", "collectionDate": "2024-01-01"}]}
80+
import traceback
81+
82+
error_message = f"Error fetching/parsing data for Eastleigh: {str(e)}\n{traceback.format_exc()}"
83+
print(error_message)
84+
# Use the correct date format for the error fallback
85+
today = datetime.now().strftime("%d/%m/%Y")
86+
return {"bins": [{"type": "Error", "collectionDate": today}]}
8287
finally:
8388
if "driver" in locals():
8489
driver.quit()

0 commit comments

Comments
 (0)