From 8d2f752efe09230878b310cd9d9244d95f834f35 Mon Sep 17 00:00:00 2001 From: 4l3x87 Date: Thu, 9 May 2019 18:57:33 +0200 Subject: [PATCH] Fix nextPage function --- channels/support.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/channels/support.py b/channels/support.py index 5e0da055..dbe48919 100644 --- a/channels/support.py +++ b/channels/support.py @@ -465,8 +465,10 @@ def nextPage(itemlist, item, data, patron, function_level=1): # If the call is direct, leave it blank next_page = scrapertoolsV2.find_single_match(data, patron) - if 'http' not in next_page: - next_page = scrapertoolsV2.find_single_match(item.url, 'https?://[a-z0-9.-]+') + next_page + + if next_page != "": + if 'http' not in next_page: + next_page = scrapertoolsV2.find_single_match(item.url, 'https?://[a-z0-9.-]+') + next_page log('NEXT= ', next_page) if next_page != "":