(.*?).*?star.*?>[^\u4e00-\u9fff]+(.*?)[^\._python正则表达式综合练习头歌">
赞
踩
- import re
-
- def parse_one_page(html):
- #*********** Begin **********#
- pattern = re.compile('<dd>.*?board-index.*?>(.*?)</i>.*?data-src="(.*?)"'
- +'.*?name.*?a.*?>(.*?)</a>.*?star.*?>[^\u4e00-\u9fff]+(.*?)[^\u4e00-\u9fff]+</p>'
- +'.*?releasetime.*?>(.*?)</p>.*?integer.*?>(.*?)</i>'
- +'.*?fraction.*?>(.*?)</i>.*?</dd>',
- re.S)
- res = re.findall(pattern, html)
- print(res)
- #*********** End **********#
'运行
赞
踩
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。