Python 防止BeautifulSoup4使用<;包装XML;html>;及<;车身>;标签
我已经使用bs4来更改XML中某些元素的一些数字字符串,但我不希望在将XML保存为文件时html或body标记出现在XML中Python 防止BeautifulSoup4使用<;包装XML;html>;及<;车身>;标签,python,xml,beautifulsoup,bs4,Python,Xml,Beautifulsoup,Bs4,我已经使用bs4来更改XML中某些元素的一些数字字符串,但我不希望在将XML保存为文件时html或body标记出现在XML中 <annotation> ... more stuff here </annotation> 使用bs4,您可以将解析器引擎更改为html。解析器: soup = BeautifulSoup(file_obj.read(), 'html.parser') 使用bs4,您可以将解析器引擎更改为html.parser: soup = Beaut
<annotation>
... more stuff here
</annotation>
使用bs4
,您可以将解析器引擎更改为html。解析器
:
soup = BeautifulSoup(file_obj.read(), 'html.parser')
使用bs4
,您可以将解析器引擎更改为html.parser
:
soup = BeautifulSoup(file_obj.read(), 'html.parser')