From 0c1908c1a4ae3cfe7f5da6c733a0fea873805342 Mon Sep 17 00:00:00 2001 From: Christian Struck Date: Sun, 19 Jan 2020 21:22:41 +0100 Subject: fix new info feature matching a departure --- bvggrabber/api/actualdeparture.py | 2 ++ bvggrabber/api/scheduleddeparture.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/bvggrabber/api/actualdeparture.py b/bvggrabber/api/actualdeparture.py index 7d90ca0..a822154 100644 --- a/bvggrabber/api/actualdeparture.py +++ b/bvggrabber/api/actualdeparture.py @@ -52,6 +52,8 @@ class ActualDepartureQueryApi(QueryApi): for row in rows: if row.parent.name == 'tbody': td = row.find_all('td') + if len(td) != 3: + continue if td: dep = Departure(start=self.station, end=td[2].text.strip(), diff --git a/bvggrabber/api/scheduleddeparture.py b/bvggrabber/api/scheduleddeparture.py index bceafc7..55634fe 100644 --- a/bvggrabber/api/scheduleddeparture.py +++ b/bvggrabber/api/scheduleddeparture.py @@ -70,6 +70,8 @@ class ScheduledDepartureQueryApi(QueryApi): departures = [] for row in rows: tds = row.find_all('td') + if len(tds) != 3: + continue dep = Departure(start=self.station, end=tds[2].text.strip(), when=tds[0].text.strip(), -- cgit v1.2.3