Getting error as ascii' codec can't encode character u'\u201c' in position 73

1,513 views
Skip to first unread message

Arnab Ganguly

unread,
Dec 10, 2012, 1:38:00 AM12/10/12
to scrapy...@googlegroups.com
Hi All,
While trying to scrap a page and retrieve a particular content I am getting the below error. 
'ascii' codec can't encode character u'\u201c' in position 73: ordinal not in range(128)


Any thoughts or suggestions would be very much appreciated.
Thanks in advance,
-A

shahidashraff

unread,
Dec 10, 2012, 5:58:47 AM12/10/12
to scrapy...@googlegroups.com
write the code line what u are doing at which error occurs> This error usually occurs when converting unicode to ascii in python(default for python) so u need different encoding or ignore that ascii encoding for particular unicode character

before processing the scraped data from a crawler
where x is a scraped string
x.encode('utf-8',errors='replace')
x.encode('ascii',errors='ignore')
and then process the string x
Reply all
Reply to author
Forward
0 new messages