爬虫 -- UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe6 in position 301: unexpected end of data

 errors参数有3个值:strict,  ignore,  replace

 

html.decode("utf-8"),这种形式有时会报错,那么修改为下面形式,将decode函数的第二个参数errors设置为ignore,默认是strict
html.decode("utf-8",'ignore')


posted @ 2019-06-30 21:07  limalove  阅读(1643)  评论(0编辑  收藏  举报