问题
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