这是我的代码:
name = namestr.decode("utf-8") name.replace(u"\u2018", "").replace(u"\u2019", "").replace(u"\u201c","").replace(u"\u201d", "")
这似乎不起作用。我仍然在我的文本中找到&ldquo,&rdquo等。此外,此文本已使用 Beautiful Soup 进行解析。
&ldquo
&rdquo
python beautifulsoup smart-quotes nltk
beautifulsoup ×1
nltk ×1
python ×1
smart-quotes ×1