use mobile API to search housings too

This commit is contained in:
Romain Bignon 2012-02-16 17:04:54 +01:00
commit 0b74d5a8c4
3 changed files with 35 additions and 34 deletions

View file

@ -34,8 +34,7 @@ class SeLogerBrowser(BaseBrowser):
ENCODING = 'utf-8'
USER_AGENT = BaseBrowser.USER_AGENTS['android']
PAGES = {
'http://www.seloger.com/(pre)?recherche.htm.*': SearchResultsPage,
'http://www.seloger.com/annonces.htm.*': SearchResultsPage,
'http://ws.seloger.com/search.xml.*': SearchResultsPage,
'http://ws.seloger.com/annonceDetail.xml\?idAnnonce=(\d+)(&noAudiotel=\d)?': HousingPage,
}
@ -52,9 +51,11 @@ class SeLogerBrowser(BaseBrowser):
'px_loyermin': cost_min or '',
'surfacemax': area_max or '',
'surfacemin': area_min or '',
'tri': 'd_dt_crea',
}
self.location(self.buildurl('/prerecherche.htm', **data))
self.location(self.buildurl('http://ws.seloger.com/search.xml', **data))
assert self.is_on_page(SearchResultsPage)
return self.page.iter_housings()