【发布时间】:2012-08-25 05:22:48
【问题描述】:
我写了这样的代码:
print re.findall(r'(<td width="[0-9]+[%]?" align="(.+)">|<td align="(.+)"> width="[0-9]+[%]?")([ \n\t\r]*)([0-9,]+\.[0-9]+)([ \n\t\r]*)([&]?[a-zA-Z]+[;]?)([ \n\t\r]*)<span class="(.+)">',r.text,re.MULTILINE)
得到这条线:
<td width="47%" align="left">556.348 <span class="uccResCde">
我想要值 556.348。如何使用regular expressions 获得它?
【问题讨论】:
标签: python html regex python-3.x python-2.7