|
发表于 2018-3-7 22:42:10
|
显示全部楼层
本帖最后由 ru1404 于 2018-3-7 22:55 编辑
首先报错
File "spider.py", line 39
SyntaxError: Non-ASCII character '\xe6' in file spider.py on line 39, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details
解决文字编码 又出现错误 环境是centos 6.9 windows 没有问题
Traceback (most recent call last):
File "spider.py", line 79, in <module>
run()
File "spider.py", line 68, in run
info=s.find_info(page)
File "spider.py", line 15, in find_info
info=re.findall(r'clickitem="(.*?)".*?t ">\n(.*?)\n.*?</span>',str(req.text),re.M)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 1818-1821: ordinal not in range(128)
|
|