use urllib to escape queries
This commit is contained in:
parent
4dfa8654b3
commit
be359ba655
2 changed files with 6 additions and 5 deletions
|
|
@ -41,10 +41,10 @@ class MeteofranceBackend(BaseBackend, ICapWeather):
|
|||
return self.create_browser()
|
||||
|
||||
def get_current(self, city_id):
|
||||
return self.browser.get_current(city_id.split("@")[0])
|
||||
return self.browser.get_current(city_id)
|
||||
|
||||
def iter_forecast(self, city_id):
|
||||
return self.browser.iter_forecast(city_id.split("@")[0])
|
||||
return self.browser.iter_forecast(city_id)
|
||||
|
||||
def iter_city_search(self, pattern):
|
||||
return self.browser.iter_city_search(pattern.replace(' ','+'))
|
||||
return self.browser.iter_city_search(pattern)
|
||||
|
|
|
|||
|
|
@ -16,9 +16,10 @@
|
|||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
|
||||
import urllib
|
||||
|
||||
from weboob.tools.browser import BaseBrowser
|
||||
|
||||
#from .pages.index import
|
||||
from .pages.meteo import WeatherPage, CityPage
|
||||
|
||||
|
||||
|
|
@ -42,7 +43,7 @@ class MeteofranceBrowser(BaseBrowser):
|
|||
BaseBrowser.__init__(self, *args, **kwargs)
|
||||
|
||||
def iter_city_search(self, pattern):
|
||||
searchurl = self.CITY_SEARCH_URL.format( city_pattern=pattern )
|
||||
searchurl = self.CITY_SEARCH_URL.format(city_pattern=urllib.quote_plus(pattern))
|
||||
self.location(searchurl)
|
||||
|
||||
if self.is_on_page(CityPage):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue