[leboncoin] improve cities display in search
This commit is contained in:
parent
a759c2c81e
commit
0ce124119c
3 changed files with 5 additions and 4 deletions
|
|
@ -69,7 +69,7 @@ class LeboncoinBrowser(PagesBrowser):
|
|||
def decode_query(self, query):
|
||||
cities = []
|
||||
for c in query.cities:
|
||||
cities.append('%s %s' % (c.id, c.name))
|
||||
cities.append(c.name)
|
||||
|
||||
if len(cities) == 0:
|
||||
return list()
|
||||
|
|
|
|||
|
|
@ -67,7 +67,6 @@ class LeboncoinModule(Module, CapHousing):
|
|||
'guyane',
|
||||
'reunion']))
|
||||
|
||||
|
||||
def create_default_browser(self):
|
||||
region = self.config['region'].get()
|
||||
return self.create_browser(region)
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
from decimal import Decimal
|
||||
from weboob.browser.pages import HTMLPage, pagination
|
||||
from weboob.browser.elements import ItemElement, ListElement, method
|
||||
from weboob.browser.filters.standard import CleanText, Regexp, CleanDecimal, Env, DateTime, BrowserURL
|
||||
from weboob.browser.filters.standard import CleanText, Regexp, CleanDecimal, Env, DateTime, BrowserURL, Format
|
||||
from weboob.browser.filters.html import Attr, Link, CleanHTML
|
||||
from weboob.capabilities.housing import City, Housing, HousingPhoto
|
||||
from weboob.capabilities.base import NotAvailable
|
||||
|
|
@ -36,7 +36,9 @@ class CityListPage(HTMLPage):
|
|||
klass = City
|
||||
|
||||
obj_id = CleanText('./span[@class="zipcode"]')
|
||||
obj_name = CleanText('./span[@class="city"]')
|
||||
obj_name = Format('%s %s',
|
||||
CleanText('./span[@class="city"]'),
|
||||
CleanText('./span[@class="zipcode"]'))
|
||||
|
||||
|
||||
class HousingListPage(HTMLPage):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue