本文实例为大家分享了python爬取淘宝商品的具体代码,供大家参考,具体内容如下
import requests as req
import re
def getHTMLText(url):
try:
r = req.get(url, timeout=30)
r.raise_for_status()
r.encoding = r.apparent_encoding
return r.text
except:
return ""
def parasePage(ilt, html):
try:
plt = re.findall(r'\"view_price\"\:\"[\
1