Skip to content
This repository was archived by the owner on Nov 19, 2021. It is now read-only.

Commit d4a53e6

Browse files
committed
Fix scraping, format changed again
1 parent 3f3fd68 commit d4a53e6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

custom_components/coronavirus_hessen/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,13 @@ async def async_get_data():
7575

7676
for row in rows[1:]:
7777
line = row.select("td")
78-
if len(line) != 4:
78+
if len(line) != 5:
7979
continue
8080

8181
try:
8282
county = line[0].text.strip()
8383
cases = parse_num(line[1].text.strip())
84-
deaths = parse_num(line[3].text.strip())
84+
deaths = parse_num(line[2].text.strip())
8585
except:
8686
_LOGGER.exception("Error processing line {}, skipping".format(line))
8787
continue
@@ -107,4 +107,4 @@ async def async_get_data():
107107
def parse_num(s, t=int):
108108
if len(s) and s != "-":
109109
return t(s.replace(".", "").replace(",", "."))
110-
return 0
110+
return 0

0 commit comments

Comments
 (0)