python讀取文件報錯UnicodeDecodeError: 'gbk' codec can't decode byte 0x8d in position 200: ille

解決辦法: 在open函數裏面加一個encoding=‘UTF-8’html with open("login.html", "r", encoding='UTF-8') as f: data = f.read() 或者:將讀取形式改成「rb」web with open("login.html", "rb") as f: data = f.read()
相關文章
相關標籤/搜索