脚本在PyScripter中运行良好,崩溃python.exe(Beautifulsoup编码错误)

2024-10-01 13:25:26 发布

您现在位置:Python中文网/ 问答频道 /正文

def getPlural():
plural = soup.find("span", class_="form-of lang-de plural-form-of")
if plural == None:
    return None
else:
    return plural.get_text()

问题似乎出在我代码的这一部分。Pyscripter处理得很好,Python.exe返回Error: 'charmap' codec can't encode character \xe4 in position 9: character maps to undefined.

PyScripter和Python.exe运行相同的版本(3.3)。为什么会这样?我怎么解决这个问题?在


Tags: offormnonelangreturndefdefind