Beautiful Soup conversion of Unicode characters to HTML entities

╄→гoц情女王★ 提交于 2021-02-08 09:16:00

问题


This error occurs after loading the document into beautifulsoup
The document contains entities like “ which gets converted to ΓÇ£
I want to output the html entities “


回答1:


use this refernce link

 from bs4 import BeautifulSoup
    soup = BeautifulSoup(html_doc)
    print(soup.prettify(formatter="html"))


来源:https://stackoverflow.com/questions/23191624/beautiful-soup-conversion-of-unicode-characters-to-html-entities

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!