Skip to content

Commit 4ce0f53

Browse files
committed
Replace usage of deprecated class by its parsel\'s counterpart
1 parent 68d2311 commit 4ce0f53

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

scrapy/linkextractors/__init__.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,14 @@
66
For more info see docs/topics/link-extractors.rst
77
"""
88
import re
9+
910
from six.moves.urllib.parse import urlparse
11+
from parsel.csstranslator import HTMLTranslator
1012

11-
from scrapy.selector.csstranslator import ScrapyHTMLTranslator
12-
from scrapy.utils.url import url_is_from_any_domain
13-
from scrapy.utils.url import canonicalize_url, url_is_from_any_domain, url_has_any_extension
1413
from scrapy.utils.misc import arg_to_iter
14+
from scrapy.utils.url import (
15+
canonicalize_url, url_is_from_any_domain, url_has_any_extension,
16+
)
1517

1618

1719
# common file extensions that are not followed if they occur in links
@@ -42,7 +44,7 @@
4244

4345
class FilteringLinkExtractor(object):
4446

45-
_csstranslator = ScrapyHTMLTranslator()
47+
_csstranslator = HTMLTranslator()
4648

4749
def __init__(self, link_extractor, allow, deny, allow_domains, deny_domains,
4850
restrict_xpaths, canonicalize, deny_extensions, restrict_css):

0 commit comments

Comments
 (0)