import requests
import pprint
import re
header={'referer':'https://item.taobao.com/item.htm?id=631616504459&ali_refid=a3_430673_1006:1151366045:N:gEehE62voDhOlPSLgaJoR8TvP3gQW7cW:5c905e26e2549ce893ad9d54dd748a46&ali_trackid=1_5c905e26e2549ce893ad9d54dd748a46&spm=a2e0b.20350158.31919782.12','user-agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.87 Safari/537.36 SE 2.X MetaSr 1.0','cookie': '加上自己淘宝网站的cookie'
def page_content():
response=requests.get(url,headers=header).text
#print(response)
data=re.findall('"content":"(.*?)"',response)
time=re.findall('"date":"(.*?)",',response)
name=re.findall('"nick":"(.*?)",',response)
# pprint.pprint(response)
print(data)
print(time)
print(name)
page_content()
|