37,722
社区成员
发帖
与我相关
我的任务
分享
<li>
<a href="/index.php?r=p/d&id=2495359&u=511624" class="img" >
<img src="https://img.alicdn.com/imgextra/i1/TB1e5egKXXXXXbOXVXXXXXXXXXX_!!2-item_pic.png_240x240.jpg" alt="">
</a>
<a href="/index.php?r=p/d&id=2495359&u=511624" class="title">
<div class="text">伊斯卡尔 新生儿宝宝外出罐奶粉</div>
</a>
<div class="price-wrapper">
<span class="price">¥<b>39</b></span>
<span class="text">券后</span>
</div>
</li>
# -*- coding:utf-8 -*-
import urllib2
import re
url='http://www.dataoke.com/qlist/?px=zh&tqg_jhs=calculate'
req=urllib2.Request(url)
res=urllib2.urlopen(req)
html=res.read()
html=html.decode('utf-8')
#print html
pattern=re.compile(r'class="goods-info".*?href="(.*?)".*?-->(.*?)</a>.*?</i>(.*?)</b>',re.S)
results=pattern.findall(html)
for result in results:
print result[0],result[1],result[2]