Add check for missing collection dates

This commit is contained in:
ReneNulschDE.github@Nulsch.de
2024-01-22 17:37:17 +01:00
committed by 5ila5
parent 4379e19fb4
commit 78289d7636

View File

@@ -29,7 +29,6 @@ class Source:
self._uprn = str(uprn)
def fetch(self):
s = requests.Session()
r = s.get(
f"https://exeter.gov.uk/repositories/hidden-pages/address-finder/?qsource=UPRN&qtype=bins&term={self._uprn}"
@@ -41,7 +40,9 @@ class Source:
dates = soup.findAll("h3")
entries = []
for (b, d) in zip(bins, dates):
for b, d in zip(bins, dates):
# check cases where no date is given for a collection
if d and len(d.text.split(",")) > 1:
entries.append(
Collection(
date=datetime.strptime(