Demo entry 6685873

通过正则表达式解析获取数据

   

Submitted by 刘尧 on Dec 22, 2017 at 02:21
Language: Python. Code size: 230 Bytes.

pattern = re.compile('<table width=".*?<div class="pl2">.*?>(.*?)</a>.*?class="pl">(.*?)</p>'   
                   + '.*?<span class="rating_nums">(.*?)</span>.*?class="pl">(.*?)</span>', re.S)
items = re.findall(pattern, html)

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).