diff --git a/custom_components/waste_collection_schedule/waste_collection_schedule/source/salford_gov_uk.py b/custom_components/waste_collection_schedule/waste_collection_schedule/source/salford_gov_uk.py index 2ca446569..071ffee56 100644 --- a/custom_components/waste_collection_schedule/waste_collection_schedule/source/salford_gov_uk.py +++ b/custom_components/waste_collection_schedule/waste_collection_schedule/source/salford_gov_uk.py @@ -27,15 +27,17 @@ def __init__(self, uprn: int): self._uprn = uprn def fetch(self): + url = "https://www.salford.gov.uk/bins-and-recycling/bin-collection-days/your-bin-collections/" params = {"UPRN": self._uprn} - r = requests.get( - "https://www.salford.gov.uk/bins-and-recycling/bin-collection-days/your-bin-collections/", - params=params, - ) + headers = { + "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 Edg/131.0.0.0" + } + + r = requests.get(url, params=params, headers=headers) r.raise_for_status() soup = BeautifulSoup(r.text, features="html.parser") - results = soup.find_all("div", {"class": "col-xs-12 col-md-6"}) + results = soup.find_all("div", {"class": "col-12 col-lg-6"}) entries = []