Skip to content
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

HTML Entities got converted by Selector #166

Open
Xiaojin1215 opened this issue Nov 4, 2019 · 0 comments
Open

HTML Entities got converted by Selector #166

Xiaojin1215 opened this issue Nov 4, 2019 · 0 comments

Comments

@Xiaojin1215
Copy link

Xiaojin1215 commented Nov 4, 2019

sel = parsel.Selector(text=u'<html><body><span>go&nbsp;od</span></body></html>') sel.xpath('//body').extract()
For the above two lines of code, we'll get an output like this:
['<body><span>go\xa0od</span></body>']
I'm curious is there a way to get an output like this, with the original html entities in it without any conversion?
['<body><span>go&nbsp;od</span></body>']

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants