Created
April 16, 2016 06:47
-
-
Save sjs7007/655c16b88e1a7eb131c1b7916b53f7ec to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib2 | |
def getTimings(stopName,stopUrl,waitUrl): | |
pageHtml = urllib2.urlopen(stopUrl).read() | |
startPos = pageHtml.find(waitUrl)+len(waitUrl) | |
endPos = pageHtml.find('<ab',startPos) | |
print(stopName,pageHtml[startPos:endPos]), | |
getTimings('Ra','http://ufl.transloc.com/t/stops/4093246','<td class="wait_time time_1" width="110px"><a href="/t/routes/4001170" title="View all of Butler Plaza">') | |
#getTimings('Re','http://ufl.transloc.com/t/stops/4091138','<td class="wait_time time_1" width="110px"><a href="/t/routes/4001170" title="View all of Butler Plaza">') | |
getTimings('Re','http://ufl.transloc.com/t/stops/4093250','<td class="wait_time time_1" width="110px"><a href="/t/routes/4001170" title="View all of Butler Plaza">') | |
getTimings('G','http://ufl.transloc.com/t/stops/4093766','<td class="wait_time time_1" width="110px"><a href="/t/routes/4001170" title="View all of Butler Plaza">') | |
#getTimings('A','http://ufl.transloc.com/t/stops/4093774','<td class="wait_time time_1" width="110px"><a href="/t/routes/4001170" title="View all of Butler Plaza">') | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment