Skip to content

Instantly share code, notes, and snippets.

@sjs7007
Created April 16, 2016 06:47
Show Gist options
  • Save sjs7007/655c16b88e1a7eb131c1b7916b53f7ec to your computer and use it in GitHub Desktop.
Save sjs7007/655c16b88e1a7eb131c1b7916b53f7ec to your computer and use it in GitHub Desktop.
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