diff --git a/agenda/waste_schedule.py b/agenda/waste_schedule.py index 5e63423..e9b9994 100644 --- a/agenda/waste_schedule.py +++ b/agenda/waste_schedule.py @@ -2,6 +2,7 @@ import json import os +import re import typing from collections import defaultdict from datetime import date, datetime, timedelta @@ -41,9 +42,12 @@ async def get_html(data_dir: str, postcode: str, uprn: str) -> str: now_str = now.strftime("%Y-%m-%d_%H:%M") filename = f"{waste_dir}/{now_str}.html" + forms_base_url = "https://forms.n-somerset.gov.uk" + # url2 = "https://forms.n-somerset.gov.uk/Waste/CollectionSchedule/ViewSchedule" + url = "https://forms.n-somerset.gov.uk/Waste/CollectionSchedule" async with httpx.AsyncClient() as client: r = await client.post( - "https://forms.n-somerset.gov.uk/Waste/CollectionSchedule", + url, data={ "PreviousHouse": "", "PreviousPostcode": "-", @@ -51,6 +55,11 @@ async def get_html(data_dir: str, postcode: str, uprn: str) -> str: "SelectedUprn": uprn, }, ) + form_post_html = r.text + pattern = r'