From c28c42f1409f7337f049fa21d16b7724699869a0 Mon Sep 17 00:00:00 2001 From: Bezleputh Date: Fri, 4 Sep 2015 13:43:04 +0200 Subject: [PATCH] [leboncoin] get main photo when there is no carousel --- modules/leboncoin/pages.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/leboncoin/pages.py b/modules/leboncoin/pages.py index 34b4a3d4..f431e602 100644 --- a/modules/leboncoin/pages.py +++ b/modules/leboncoin/pages.py @@ -176,4 +176,9 @@ class HousingPage(HTMLPage): default='')(img) if url: photos.append(HousingPhoto(url)) + + if not photos: + img = self.el.xpath('//div[@class="lbcImages"]/meta/@content') + if img: + photos.append(HousingPhoto(img[0])) return photos