python-UnicodeDecodeError: 'gbk' codec can't decode byte 0xa8 in position 157: illegal multibyte sequence


  • UnicodeDecodeError: 'gbk' codec can't decode byte 0xa8 in position 157: illegal multibyte sequence永久解决方法
  • 打开PyQuery文件导入     import chardet      模块将217行代码改为
  • 1  if 'filename' in kwargs: 2                 txt = open('./test_01.html', 'rb').read()#./test_01.html运行文件
    3                 encoding = chardet.detect(txt)['encoding'] 4                 html = open(kwargs['filename'],encoding=encoding)

     


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM