aboutsummaryrefslogtreecommitdiff
path: root/bvggrabber/api
diff options
context:
space:
mode:
authorMarkus Holtermann <info@markusholtermann.eu>2020-01-21 00:11:12 +0100
committerGitHub <noreply@github.com>2020-01-21 00:11:12 +0100
commitb86f5e35f328a354d14871d3dc244fff5ec9970a (patch)
tree9e4321b9154bf330cf0cfbfaad2db68079f4c8ca /bvggrabber/api
parent2540991c4f2f16b7593d169b7b5aa59e6ccaf3c7 (diff)
parent0c1908c1a4ae3cfe7f5da6c733a0fea873805342 (diff)
downloadbvg-grabber-b86f5e35f328a354d14871d3dc244fff5ec9970a.tar.gz
bvg-grabber-b86f5e35f328a354d14871d3dc244fff5ec9970a.tar.bz2
bvg-grabber-b86f5e35f328a354d14871d3dc244fff5ec9970a.zip
Merge pull request #19 from MarkusH/fix_18
fix new info feature matching a departure
Diffstat (limited to 'bvggrabber/api')
-rw-r--r--bvggrabber/api/actualdeparture.py2
-rw-r--r--bvggrabber/api/scheduleddeparture.py2
2 files changed, 4 insertions, 0 deletions
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(),