我刚才已经成功添加了requests库了,可是还是没法模拟买到鞋子呀。我的程序如下:#-*-coding:UTF-8-*-importurllib,urllib2,cookielibimportpdbimportreimportrequestsimporttimeimpo...
我刚才已经成功添加了requests库了,可是还是没法模拟买到鞋子呀。我的程序如下:
#-*- coding:UTF-8 -*-
import urllib,urllib2,cookielib
import pdb
import re
import requests
import time
import json
payload = {"events":[{"pid":"10264902","qty":"1","skuAndSize":"11563868:38","name":"addToCartEvent","t":1428655823350}],"g":"30c873c2-7e1f-4476-d528-0c9937112397","t":1428655823350,"vID":"0.8.8"}
header = {'User-Agent':'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.153 Safari/537.36',
'Referer':'http://store.nike.com/cn/zh_cn/pd/air-max-2015-%E8%B7%91%E6%AD%A5%E9%9E%8B/pid-10200900/pgid-10047075',
'Accept-Encoding':'gzip,deflate,sdch',
'Host':'nod.nikecloud.com',
'DNT':'1',
'Content-Type':'text/plain',
'Content-Length':'185',
'Connection':'keep-alive',
'Accept-Language':'en-US,en;q=0.8',
'Accept':'*/*',
'Origin':'http://store.nike.com'}
buyshoe_url = 'http://nod.nikecloud.com/nod/rest/intake'
r = requests.get(buyshoe_url, params = payload, headers = header)
可是运行之後还是没成功。
展开