From a354edec251bf69846a37549c3bcb651259d44f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20P=C3=A9rez-Cerezo?= Date: Thu, 21 Oct 2021 15:56:00 +0200 Subject: Filter out covid information BVG inserts covid info as a schedule entry, which caused the script to crash. --- bvggrabber/api/scheduleddeparture.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'bvggrabber') diff --git a/bvggrabber/api/scheduleddeparture.py b/bvggrabber/api/scheduleddeparture.py index 69defcf..fbafe66 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) < 2: + continue stro = row.find_all('strong') dep = Departure(start=self.station, end=tds[2].text.strip(), -- cgit v1.2.3