37,721
社区成员
发帖
与我相关
我的任务
分享
>>> s = '''<html>
<head>
<title></title>
</head>
<body>
<div>test</div>
<h3>hh33</h3>
<p>asdf</p>
</body>
</html>'''
>>> import re
>>> res = r'<div>(.*?)</div>.*?<p>(.*?)</p>'
>>> m = re.findall(res,s,re.S|re.M)
>>> m
[('test', 'asdf')]
>>>