summaryrefslogtreecommitdiff
path: root/updatebusinfo.py
diff options
context:
space:
mode:
Diffstat (limited to 'updatebusinfo.py')
-rw-r--r--updatebusinfo.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/updatebusinfo.py b/updatebusinfo.py
new file mode 100644
index 0000000..3663d24
--- /dev/null
+++ b/updatebusinfo.py
@@ -0,0 +1,14 @@
+import sys
+from bs4 import BeautifulSoup
+import urllib2
+
+for id in ('1', '1A', '1G', '2', '2A', '3', '4', '5', '7', '7a', '8', '9', '12', '13', '15', '16', '19', '21', '22', 'x22', '23', '28'):
+ bus = '/' + id + '/FALSE'
+ url = 'http://libertybus.je/routes_times/timetables' + bus
+ page = urllib2.urlopen(url)
+ soup = BeautifulSoup(page)
+ table = soup.findAll(['tr', 'h2'])
+ sys.stdout = open(id + '.txt', 'w')
+ print table
+
+