[meteofrance] fix #1431, call the url that retrieve all the search results
This commit is contained in:
parent
e5601f9476
commit
8ca5c619c5
2 changed files with 21 additions and 21 deletions
|
|
@ -20,14 +20,24 @@
|
|||
|
||||
|
||||
from weboob.tools.browser import BasePage
|
||||
from weboob.capabilities.weather import Forecast, Current
|
||||
from weboob.capabilities.weather import Forecast, Current, City
|
||||
|
||||
import datetime
|
||||
|
||||
import re
|
||||
|
||||
__all__ = ['WeatherPage']
|
||||
|
||||
|
||||
class SearchCitiesPage(BasePage):
|
||||
def iter_cities(self):
|
||||
list = self.document.getroot().xpath('//ul[@class="list-style-1"]/li/a')
|
||||
for a in list:
|
||||
m = re.search('/.*/(.*)/(\d{5})', a.attrib.get('href'))
|
||||
if m:
|
||||
mcity = City(int(m.group(2)), u'%s' % m.group(1))
|
||||
yield mcity
|
||||
|
||||
|
||||
class WeatherPage(BasePage):
|
||||
def get_temp_without_unit(self, temp_str):
|
||||
# It seems that the mechanize module give us some old style
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue