New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LxmlLinkExtractor
fails handling unicode netlocs in Python2
#2323
Labels
Comments
I tested scrapy 1.2.0 with scrapy/w3lib#75 (scrapy/w3lib@10865d9) and it fixes the issue:
|
any progress on this issue? |
this happens to me also on 1.3.0 version? |
Upgrading from Scrapy 1.3.3 to 1.4.0 seems to fix this for me. |
@redapple do you think there's anything else to do in this issue? 😄😄😄 |
Working since (at least) Python 3
In [1]: from scrapy.http import TextResponse
...: from scrapy.linkextractors import LinkExtractor
...: response = TextResponse(url='http://foo.com', body=u'<a href="http://foo\u263a">', encoding='utf8')
...: response.css('a::attr(href)').extract()
...: extractor = LinkExtractor()
...: extractor.extract_links(response)
Out[1]: [Link(url='http://foo☺', text='', fragment='', nofollow=False)] Python 2
In [1]: from scrapy.http import TextResponse
...: from scrapy.linkextractors import LinkExtractor
...: response = TextResponse(url='http://foo.com', body=u'<a href="http://foo\u263a">', encoding='utf8')
...: response.css('a::attr(href)').extract()
...: extractor = LinkExtractor()
...: extractor.extract_links(response)
...:
Out[1]: [Link(url='http://foo\xe2\x98\xba', text=u'', fragment='', nofollow=False)] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Affected version:
dc1f9ad
Affected Python version:
Python 2 only
Steps to reproduce:
The text was updated successfully, but these errors were encountered: