[weboob] [PATCH 1/1] leboncoin: fix cost for items in rent search page

Simon Lipp laiquo at hwold.net
Tue Jan 3 16:47:54 CET 2017


In rent search page, there is a tag ("C.C.") associated with the price,
which break CleanDecimal. Leave it out of xpath selector.

Signed-off-by: Simon Lipp <laiquo at hwold.net>
---
 modules/leboncoin/pages.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/leboncoin/pages.py b/modules/leboncoin/pages.py
index 59b448116..ea205c3f8 100644
--- a/modules/leboncoin/pages.py
+++ b/modules/leboncoin/pages.py
@@ -106,7 +106,7 @@ class HousingListPage(HTMLPage):
                             '\\2', default=None)
 
             obj_title = CleanText('./@title|./section/p[@class="item_title"]')
-            obj_cost = CleanDecimal('./section[@class="item_infos"]/*[@class="item_price"]',
+            obj_cost = CleanDecimal('./section[@class="item_infos"]/*[@class="item_price"]/text()',
                                     replace_dots=(',', '.'),
                                     default=Decimal(0))
             obj_currency = Regexp(CleanText('./section[@class="item_infos"]/*[@class="item_price"]'),
-- 
2.11.0




More information about the weboob mailing list