0

I need extract information of a web page with python , in perl i use this code:

if($body =~ /info(.*)info/){
print $1;
}

how to convert this code for python ?

4

1 回答 1

2

尝试这样的事情:

import re

body = '' # your text here

for m in re.findall('info(.*)info', body):
    print m

re文档中阅读更多信息

于 2013-02-06T16:37:07.313 回答