在用py2写爬虫,将内容写入文件时出现 UnicodeEncodeError错误解决方法:str = str.replace(u'\u2019','\'').encode('utf8') 转载于:https://www.cnblogs.com/edhg/p/6845124.html