【发布时间】:2016-03-29 21:15:53
【问题描述】:
我有一个大字符串,格式如下:
'324/;.ke5 efwef dwe,werwrf <>i want this<> ergy;'56\45,> thu ;lokr<>i want this<> htur ;''\> htur> jur'
我知道我可以做一些事情:
result= text.partition('<>')[-1].rpartition('<>')[0]
但这只会给我字符串中第一个 和最后一个 之间的内容,我如何遍历整个字符串并提取每个相应 标签对之间的内容?
【问题讨论】:
标签: python html string parsing tags