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