python3 UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc9 in position 167

出现这个错误 这是由于byte字符组没解码好,要加另外一个参数 官方文档中也这么写到

原代码
html.decode(”utf-8”)
改后
html.decode(encoding=”utf-8”, errors=”strict”)

猜你喜欢

转载自blog.csdn.net/AnYeZhiYin/article/details/82967840