Add debug output on matched XPath/CSS expression.

This commit is contained in:
Tobias Gruetzmacher 2016-04-20 23:51:54 +02:00
parent 1d2e1f2dd1
commit 5bd2a49f48

View file

@ -468,9 +468,13 @@ class _ParserScraper(Scraper):
try: try:
for attrib in html_link_attrs: for attrib in html_link_attrs:
if attrib in match.attrib: if attrib in match.attrib:
searchUrls.append(match.get(attrib)) searchUrl = match.get(attrib)
except AttributeError: except AttributeError:
searchUrls.append(str(match)) searchUrls = str(match)
out.debug(u'Matched URL %r with pattern %s' %
(searchUrl, search))
searchUrls.append(searchUrl)
if not cls.multipleImagesPerStrip and searchUrls: if not cls.multipleImagesPerStrip and searchUrls:
# do not search other links if one pattern matched # do not search other links if one pattern matched
break break