From e317be77dbafb3d07bc9d9bed55f25de773f44db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Wed, 18 Mar 2020 10:00:01 +0100 Subject: [PATCH] Adjust scraper for new site format Closes #5 --- custom_components/coronavirus_hessen/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/custom_components/coronavirus_hessen/__init__.py b/custom_components/coronavirus_hessen/__init__.py index cbe26d9..871ea49 100644 --- a/custom_components/coronavirus_hessen/__init__.py +++ b/custom_components/coronavirus_hessen/__init__.py @@ -76,12 +76,12 @@ async def async_get_data(): # Counties for row in rows[1:-1]: line = row.select("td") - if len(line) != 4: + if len(line) != 2: continue try: county = line[0].text.strip() - cases_str = line[3].text.strip() + cases_str = line[1].text.strip() if len(cases_str) and cases_str != "-": cases = int(cases_str) else: