Scrapy, a fast high-level web crawling & scraping framework for Python.
Move scrapy/linkextractor.py to scrapy/linkextractors/__init__.py
Julia Medinad72536688fa1
diff --git a/docs/topics/link-extractors.rst b/docs/topics/link-extractors.rstindex edb047c86..f9b25ae63 100644--- a/docs/topics/link-extractors.rst+++ b/docs/topics/link-extractors.rst@@ -78,8 +78,8 @@ LxmlLinkExtractor:param deny_extensions: a single value or list of strings containingextensions that should be ignored when extracting links.If not given, it will default to the- ``IGNORED_EXTENSIONS`` list defined in the `scrapy.linkextractor`_- module.+ ``IGNORED_EXTENSIONS`` list defined in the+ `scrapy.linkextractors`_ module.:type deny_extensions: list:param restrict_xpaths: is an XPath (or list of XPath's) which defines@@ -132,4 +132,4 @@ LxmlLinkExtractor:type process_value: callable-.. _scrapy.linkextractor: https://github.com/scrapy/scrapy/blob/master/scrapy/linkextractor.py+.. _scrapy.linkextractors: https://github.com/scrapy/scrapy/blob/master/scrapy/linkextractors/__init__.pydiff --git a/scrapy/linkextractor.py b/scrapy/linkextractors/__init__.pysimilarity index 94%rename from scrapy/linkextractor.pyrename to scrapy/linkextractors/__init__.pyindex 2a4d18877..8567dbb76 100644--- a/scrapy/linkextractor.py+++ b/scrapy/linkextractors/__init__.py@@ -1,6 +1,9 @@"""-Common code and definitions used by Link extractors (located in-scrapy.linkextractors).+scrapy.linkextractors++This package contains a collection of Link Extractors.++For more info see docs/topics/link-extractors.rst"""import refrom six.moves.urllib.parse import urlparse@@ -98,3 +101,6 @@ class FilteringLinkExtractor(object):def _extract_links(self, *args, **kwargs):return self.link_extractor._extract_links(*args, **kwargs)++# Top-level imports+from .lxmlhtml import LxmlLinkExtractor as LinkExtractordiff --git a/scrapy/linkextractors/lxmlhtml.py b/scrapy/linkextractors/lxmlhtml.pyindex 1ff8e4d36..1c31a15b5 100644--- a/scrapy/linkextractors/lxmlhtml.py+++ b/scrapy/linkextractors/lxmlhtml.py@@ -11,7 +11,7 @@ from scrapy.selector import Selectorfrom scrapy.link import Linkfrom scrapy.utils.misc import arg_to_iterfrom scrapy.utils.python import unique as unique_list, str_to_unicode-from scrapy.linkextractor import FilteringLinkExtractor+from scrapy.linkextractors import FilteringLinkExtractorfrom scrapy.utils.response import get_base_urldiff --git a/scrapy/linkextractors/sgml.py b/scrapy/linkextractors/sgml.pyindex 88d2d5b91..bae4ad5c0 100644--- a/scrapy/linkextractors/sgml.py+++ b/scrapy/linkextractors/sgml.py@@ -8,7 +8,7 @@ from sgmllib import SGMLParserfrom w3lib.url import safe_url_stringfrom scrapy.selector import Selectorfrom scrapy.link import Link-from scrapy.linkextractor import FilteringLinkExtractor+from scrapy.linkextractors import FilteringLinkExtractorfrom scrapy.utils.misc import arg_to_iterfrom scrapy.utils.python import unique as unique_list, str_to_unicodefrom scrapy.utils.response import get_base_url