From d4a53e6df92d03c22aadbd17f2f4f3c153342971 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Thu, 2 Apr 2020 13:03:21 +0200 Subject: [PATCH] Fix scraping, format changed again --- custom_components/coronavirus_hessen/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/custom_components/coronavirus_hessen/__init__.py b/custom_components/coronavirus_hessen/__init__.py index 7592a22..e242eda 100644 --- a/custom_components/coronavirus_hessen/__init__.py +++ b/custom_components/coronavirus_hessen/__init__.py @@ -75,13 +75,13 @@ async def async_get_data(): for row in rows[1:]: line = row.select("td") - if len(line) != 4: + if len(line) != 5: continue try: county = line[0].text.strip() cases = parse_num(line[1].text.strip()) - deaths = parse_num(line[3].text.strip()) + deaths = parse_num(line[2].text.strip()) except: _LOGGER.exception("Error processing line {}, skipping".format(line)) continue @@ -107,4 +107,4 @@ async def async_get_data(): def parse_num(s, t=int): if len(s) and s != "-": return t(s.replace(".", "").replace(",", ".")) - return 0 \ No newline at end of file + return 0