mirror of https://github.com/scrapy/scrapy.git
Add try/except to safe_url_string()
Added a try catch condition to the safe_url_string() processing in the LxmlParserLinkExtractor class to avoid scrapers crashing unneccessarily
This commit is contained in:
parent
8045d7eaa5
commit
90ce6589ee
|
|
@ -88,7 +88,11 @@ class LxmlParserLinkExtractor:
|
|||
url = self.process_attr(attr_val)
|
||||
if url is None:
|
||||
continue
|
||||
url = safe_url_string(url, encoding=response_encoding)
|
||||
try:
|
||||
url = safe_url_string(url, encoding=response_encoding)
|
||||
except ValueError:
|
||||
continue # Disregard badly formatted urls
|
||||
|
||||
# to fix relative links after process_value
|
||||
url = urljoin(response_url, url)
|
||||
link = Link(
|
||||
|
|
|
|||
Loading…
Reference in New Issue