fix: Update div IDs to mnatch new page structure

This commit is contained in:
Adrian Rumpold
2022-03-18 09:00:15 +01:00
parent e6c2644ea5
commit c1b7b16251

View File

@@ -109,7 +109,7 @@ class CovidCrawler(CovidCrawlerBase):
) )
soup = await self._fetch(url) soup = await self._fetch(url)
match = soup.find(id="c1067628") match = soup.find(id="c1075340")
text = match.text.strip() text = match.text.strip()
_log.debug(f"Infection data text: {text}") _log.debug(f"Infection data text: {text}")
@@ -167,9 +167,9 @@ class CovidCrawler(CovidCrawlerBase):
result = soup.find(id=container_id) result = soup.find(id=container_id)
text = re.sub(r"\s+", " ", result.text) text = re.sub(r"\s+", " ", result.text)
regexes = [ regexes = [
r"(?P<total_vaccinations>\d+([.]\d+)?) Personen in Augsburg mindestens", r"(?P<total_vaccinations>\d+([.]\d+)?) Personen in Augsburg",
r"(?P<num_vaccinated_full>\d+([.]\d+)?) Personen sind mindestens zweimal geimpft", r"(?P<num_vaccinated_full>\d+([.]\d+)?) Personen in Augsburg",
r"(?P<num_vaccinated_booster>\d+([.]\d+)?) Personen haben eine Auffrischungsimpfung", r"(?P<num_vaccinated_booster>\d+([.]\d+)?) Personen, also",
] ]
values = {} values = {}
for r in regexes: for r in regexes: