Reputation: 1321
I'm using scrapy for web crawling using python. While scraping I have some characters which are not encoded correctly like '\xa0','\x0259'. Any help how can I handle them in python?
Upvotes: 0
Views: 95
Reputation: 51
You can use the unicode string type (http://docs.python.org/2/tutorial/introduction.html#unicode-strings) by prepending all instances of characters like these with u
. For example u'\xa0'
and u'\x0259'
. The unicode-strings python docs also provide some other methods for encoding and decoding these strings and characters.
Upvotes: 1