<
beautifulsoup content missing
>
上一篇

更新证书
下一篇

vscode task
content missing

beautifulsoup内容缺失

记录

在完成项目时,用beautuifulsoup来解析xml文件,所用的解析引擎为lxml,但发现在解析的过程中,有些特定的标签会缺失(例如header标签)

相关代码见下:

s = Beautifulsoup(filename, 'lxml')

之后在网上发现了相关的解释,总而言之,通过更换代码为:

s = Beautifulsoup(filename, 'xml')

即可解决。

Top
Foot