且构网

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

如何在Python中获取XML标签值

更新时间:2023-11-24 12:25:52

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