diff options
author | Gabriel Pérez-Cerezo <gabriel@gpcf.eu> | 2021-10-21 15:56:00 +0200 |
---|---|---|
committer | Gabriel Pérez-Cerezo <gabriel@gpcf.eu> | 2021-10-21 15:56:00 +0200 |
commit | a354edec251bf69846a37549c3bcb651259d44f7 (patch) | |
tree | 09d11d24bf024e7707aed2d8f359c0690eda8030 | |
parent | 7e74926bd8e2da4fdcdcc7ff5ca5adfc3c0c7083 (diff) | |
download | bvg-grabber-a354edec251bf69846a37549c3bcb651259d44f7.tar.gz bvg-grabber-a354edec251bf69846a37549c3bcb651259d44f7.tar.bz2 bvg-grabber-a354edec251bf69846a37549c3bcb651259d44f7.zip |
Filter out covid information
BVG inserts covid info as a schedule entry, which caused the script to crash.
-rw-r--r-- | bvggrabber/api/scheduleddeparture.py | 2 |
1 files changed, 2 insertions, 0 deletions
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(), |