【发布时间】:2014-04-10 11:23:09
【问题描述】:
如何在 python 中使用正则表达式在标签之间查找单词?
s = """<person>John</person>went to<location>London</location>"""
......
.......
print 'person of name:' John
print 'location:' London
【问题讨论】:
-
最好使用像 BeautifulSoup 这样的 html/xml 解析器
-
在任何标签之间还是在人员和位置标签之间?