且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在 Python 中获取 XML 标记值

更新时间:2022-06-22 07:04:44

BeautifulSoup 是解析 XML 的最简单方法...

BeautifulSoup is the most simple way to parse XML as far as I know...

并假设您已经阅读了介绍,那么只需简单地使用:

And assume that you have read the introduction, then just simply use:

soup = BeautifulSoup('your_XML_string')
print soup.find('text').string