When I use the accent parameter in the Scrapy Framework, my spider crashes with this error:
Traceback (most recent call last):
File "c:\python27\lib\site-packages\twisted\internet\defer.py", line 577, in _ runCallbacks
current.result = callback(current.result, *args, **kw)
File "C:\Users\DoricTsappi\Downloads\newproject\myscrap\myscrap\spiders\scrap2.py", line 44, in parse
occdoc = text.lower().count(key.lower())
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe9 in position 1: ordinal not in range(128)
Here is my code:
# -*- coding: utf-8 -*-
str) and unicode strings (unicode).