[weboob] [PATCH 1/1] seloger: Fix pagination

Simon Lipp laiquo at hwold.net
Mon Jan 2 19:22:25 CET 2017

Right now webservices of seloger.com have a bug and returns an
invalid URL for next page (http://ws.seloger.com/http://ws.seloger.com/search.xml).

Work around that by deleting everyting before the last "http://" in the

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

diff --git a/modules/seloger/pages.py b/modules/seloger/pages.py
index 8d6a58ef0..51f220ae6 100644
--- a/modules/seloger/pages.py
+++ b/modules/seloger/pages.py
@@ -17,6 +17,7 @@
 # You should have received a copy of the GNU Affero General Public License
 # along with weboob. If not, see <http://www.gnu.org/licenses/>.
+import re
 from weboob.browser.pages import XMLPage, JsonPage, pagination
 from weboob.browser.elements import ItemElement, ListElement, DictElement, method
@@ -69,7 +70,7 @@ class SearchResultsPage(XMLPage):
         def next_page(self):
             page = CleanText('//pageSuivante', default=None)(self)
             if page:
-                return page
+                return re.sub(r'.+http://', 'http://', page)
         class item(SeLogerItem):
             def obj_photos(self):

More information about the weboob mailing list