小编The*_*ger的帖子

如何在解析网页时摆脱所有智能引号?

这是我的代码:

name = namestr.decode("utf-8")

name.replace(u"\u2018", "").replace(u"\u2019", "").replace(u"\u201c","").replace(u"\u201d", "")
Run Code Online (Sandbox Code Playgroud)

这似乎不起作用。我仍然在我的文本中找到&ldquo,&rdquo等。此外,此文本已使用 Beautiful Soup 进行解析。

python beautifulsoup smart-quotes nltk

2
推荐指数
1
解决办法
3493
查看次数

标签 统计

beautifulsoup ×1

nltk ×1

python ×1

smart-quotes ×1