Fix Scrapertools e Support
This commit is contained in:
+6
-4
@@ -895,12 +895,13 @@ def match(item_url_string, **args):
|
||||
matches: all the matches
|
||||
'''
|
||||
|
||||
matches = blocks = []
|
||||
matches = []
|
||||
blocks = []
|
||||
url = None
|
||||
# arguments allowed for scrape
|
||||
patron = args.get('patron', None)
|
||||
patronBlock = args.get('patronBlock', None)
|
||||
patronBlocks = args.get('patronBlock', None)
|
||||
patronBlocks = args.get('patronBlocks', None)
|
||||
debug = args.get('debug', False)
|
||||
debugBlock = args.get('debugBlock', False)
|
||||
string = args.get('string', False)
|
||||
@@ -934,8 +935,9 @@ def match(item_url_string, **args):
|
||||
if patronBlock:
|
||||
blocks = [scrapertools.find_single_match(data, patronBlock)]
|
||||
elif patronBlocks:
|
||||
if type(patronBlock) == str: patron = [patronBlock]
|
||||
for p in patronBlock:
|
||||
if type(patronBlocks) == str:
|
||||
patronBlocks = [patronBlocks]
|
||||
for p in patronBlocks:
|
||||
blocks += scrapertools.find_multiple_matches(data, p)
|
||||
else:
|
||||
blocks = [data]
|
||||
|
||||
Reference in New Issue
Block a user