Пример #1
0
 def _get_html(self):
     url_opener = URLOpener()
     response = url_opener.open(self.url)
     if lxml:
         html = lxml.html.parse(response).getroot()
     else:
         html = html5lib.parse(response)
     return html
Пример #2
0
 def _get_html(self):
     url_opener = URLOpener()
     response = url_opener.open(self.url)
     if lxml:
         html = lxml.html.parse(response).getroot()
     else:
         html = html5lib.parse(response)
     return html
Пример #3
0
 def _get_departure_data(self):
     base_url = ('http://livetimes.transperth.wa.gov.au/LiveTimes.asmx'
                 '/GetSercoTimesForStation')
     params = {'stationname': '%s Stn' % (self.name)}
     url = '%s?%s' % (base_url, urlencode(params))
     url_opener = URLOpener()
     response = url_opener.open(url)
     tree = ElementTree.parse(response)
     return tree.getroot()
Пример #4
0
 def _get_departure_data(self):
     base_url = ('http://livetimes.transperth.wa.gov.au/LiveTimes.asmx'
                 '/GetSercoTimesForStation')
     params = {'stationname': '%s Stn' % (self.name)}
     url = '%s?%s' % (base_url, urlencode(params))
     url_opener = URLOpener()
     response = url_opener.open(url)
     tree = ElementTree.parse(response)
     return tree.getroot()
Пример #5
0
 def _get_html(self):
     url_opener = URLOpener()
     response = url_opener.open(self.url)
     html = lxml.html.parse(response).getroot()
     return html
Пример #6
0
 def _get_html(self):
     url_opener = URLOpener()
     response = url_opener.open(self.url)
     html = lxml.html.parse(response).getroot()
     return html