summaryrefslogtreecommitdiff
path: root/bvggrabber
diff options
context:
space:
mode:
authorGabriel Pérez-Cerezo <gabriel@gpcf.eu>2021-10-21 15:56:00 +0200
committerGabriel Pérez-Cerezo <gabriel@gpcf.eu>2021-10-21 15:56:00 +0200
commita354edec251bf69846a37549c3bcb651259d44f7 (patch)
tree09d11d24bf024e7707aed2d8f359c0690eda8030 /bvggrabber
parent7e74926bd8e2da4fdcdcc7ff5ca5adfc3c0c7083 (diff)
downloadbvg-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.
Diffstat (limited to 'bvggrabber')
-rw-r--r--bvggrabber/api/scheduleddeparture.py2
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(),