Scrapy, a fast high-level web crawling & scraping framework for Python.
Add logging Lines
Samuel Bartlett9ef00c5c0bc1
diff --git a/scrapy/linkextractors/lxmlhtml.py b/scrapy/linkextractors/lxmlhtml.pyindex 1ee81427c..f7c6937b0 100644--- a/scrapy/linkextractors/lxmlhtml.py+++ b/scrapy/linkextractors/lxmlhtml.py@@ -2,6 +2,7 @@Link extractor based on lxml.html"""import operator+import loggingfrom functools import partialfrom urllib.parse import urljoin, urlparse@@ -23,6 +24,8 @@ from scrapy.utils.python import unique as unique_listfrom scrapy.utils.response import get_base_urlfrom scrapy.utils.url import url_has_any_extension, url_is_from_any_domain+logger = logging.getLogger(__name__)+# from lxml/src/lxml/html/__init__.pyXHTML_NAMESPACE = "http://www.w3.org/1999/xhtml"@@ -91,6 +94,7 @@ class LxmlParserLinkExtractor:try:url = safe_url_string(url, encoding=response_encoding)except ValueError:+ logger.error(f"Skipping extraction of bad link {url}")continue # Disregard badly formatted urls# to fix relative links after process_value