Skip to content

Commit

Permalink
refactor merton_gov_uk
Browse files Browse the repository at this point in the history
  • Loading branch information
mampfes committed Mar 24, 2023
1 parent 093beac commit 2b6013e
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
from datetime import datetime

import requests
from bs4 import BeautifulSoup
from waste_collection_schedule import Collection

TITLE = "London Borough of Merton"

DESCRIPTION = (
"Source for www.merton.gov.uk services for London Borough of Merton, UK")
DESCRIPTION = "Source for www.merton.gov.uk services for London Borough of Merton, UK"

URL = "https://www.merton.gov.uk/"

Expand All @@ -15,7 +15,8 @@
"test 2": {"property": "28166100"},
}

API_URL = "https://myneighbourhood.merton.gov.uk/Wasteservices/WasteServices.aspx?ID="
API_URL = "https://myneighbourhood.merton.gov.uk/Wasteservices/WasteServices.aspx"


ICON_MAP = {
"Food waste": "mdi:food",
Expand All @@ -34,7 +35,9 @@ def __init__(self, property: str):
def fetch(self):
entries = []
session = requests.Session()
r = session.get(f"{API_URL}{self._property}")
params = {"ID": self._property}
r = session.get(API_URL, params=params)
r.raise_for_status()
soup = BeautifulSoup(r.text, features="html.parser")
soup.prettify()

Expand Down

0 comments on commit 2b6013e

Please sign in to comment.