Commit 3297651b authored by Bezleputh's avatar Bezleputh

[leboncoin] fix bugs ( 'Hier' date parsing + getting

parent 3e1a8b73
......@@ -51,7 +51,7 @@ class LeboncoinBackend(BaseBackend, CapHousing):
def fill_photo(self, photo, fields):
if 'data' in fields and photo.url and not = self.browser.readurl(photo.url) =
return photo
def search_city(self, pattern):
......@@ -22,7 +22,7 @@ from import HTMLPage, method, pagination
from import ItemElement, ListElement
from import CleanText, Link, Regexp, CleanDecimal, Env, DateTime, Attr
from weboob.capabilities.housing import City, Housing, HousingPhoto
from datetime import date
from datetime import date, timedelta
from import DATE_TRANSLATE_FR, LinearDateGuesser
......@@ -61,7 +61,8 @@ class HousingListPage(HTMLPage):
def obj_date(self):
_date = CleanText('./div[@class="lbc"]/div[@class="date"]',
replace=[('Aujourd\'hui', str(])(self)
replace=[('Aujourd\'hui', str(,
('Hier', str(( - timedelta(1)).day))])(self)
for fr, en in DATE_TRANSLATE_FR:
_date = fr.sub(en, _date)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment