diff options
-rw-r--r-- | bvggrabber/api/actualdeparture.py | 5 | ||||
-rw-r--r-- | bvggrabber/api/scheduleddeparture.py | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/bvggrabber/api/actualdeparture.py b/bvggrabber/api/actualdeparture.py index 7cdac17..f6f5fe2 100644 --- a/bvggrabber/api/actualdeparture.py +++ b/bvggrabber/api/actualdeparture.py @@ -38,7 +38,10 @@ class ActualDepartureQueryApi(QueryApi): return (False, []) else: # The station seems to exist - rows = soup.find('tbody').find_all('tr') + tbody = soup.find('tbody') + if tbody is None: + return (False, []) + rows = tbody.find_all('tr') departures = [] for row in rows: tds = row.find_all('td') diff --git a/bvggrabber/api/scheduleddeparture.py b/bvggrabber/api/scheduleddeparture.py index cf374f6..38d8f8a 100644 --- a/bvggrabber/api/scheduleddeparture.py +++ b/bvggrabber/api/scheduleddeparture.py @@ -56,7 +56,10 @@ class ScheduledDepartureQueryApi(QueryApi): return (False, []) else: # The station seems to exist - rows = soup.find('tbody').find_all('tr') + tbody = soup.find('tbody') + if tbody is None: + return (False, []) + rows = tbody.find_all('tr') departures = [] for row in rows: tds = row.find_all('td') |