草庐IT

BeautifulStoneSoup

全部标签

python - 如何在 BeautifulSoup.BeautifulStoneSoup 中维护区分大小写的标签?

我正在编写一个使用BeautifulStoneSoup编辑XML文件的脚本,但是该库将所有标签转换为小写。是否有保存案例的选项?importBeautifulSoupxml="astring"soup=BeautifulSoup.BeautifulStoneSoup(xml,markupMassage=False)printsoup.prettify()#orsoup.renderContents()#prints>>>astring#insteadoftheexpected>>>astring 最佳答案 你可以使用Beautifu