各位,我在打开一个包含汉字的HTML文件时遇到了麻烦,这是代码file =wget.download("http://nba.stats.qq.com/player/list.htm#teamId=1") html = f.read()
print(htmlin position 535: invali
['ssentence']:在上面的代码中,我试图通过api进行情感分析并将它们存储到list.However中,api只输入GBK格式,而我的数据是以utf-8编码的。因此,它通常会遇到这样的错误:
UnicodeEncodeError: 'gbk' codec can't encode character '\u30fb' in position 14: illegal