破谣言——iPhone砍价

微信朋友圈和QQ空间很多朋友在传一个iPhone砍价免费送的活动。好吧,砍页面下面的那邪恶广告,第一感觉就是假的。但我要给出证明,所以就有了下面的代码。【只需把UID换成自己的就行】,当你砍到5分钱的时候你就砍不下去了。。。。

import httplib2
http = httplib2.Http()
for i in range(10000):
    url = 'http://wx.csjjd.com.cn/wkj/invite.php?id=tom_kanjia&mod=index&kid=1&uid=自己的UID'
    response, content = http.request(url, 'GET')
    headers = {'Cookie': response['set-cookie'],
               'Referer':'http://wx.csjjd.com.cn/wkj/invite.php?id=tom_kanjia&mod=index&kid=1&uid=自己的UID'}

    a = content.find("hash")
    n_a = content.find("num_a")+14
    n_b = content.find("num_b")+14
    sum_ab=int(content[n_a])+int(content[n_b])
    fhash = content[a+13:a+21]
    url="http://wx.csjjd.com.cn/wkj/plugin.php?id=tom_kanjia&mod=ajax&act=kanjia&kid=1&uid=自己的UID&name="+str(i)
    url=url+"&num_sun="+str(sum_ab)+"&formhash="+str(fhash)+"&openid=&num_a="+str(n_a)+\
        "&num_b="+str(n_b)+"&num_count="+str(sum_ab)
    response, content = http.request(url, 'GET', headers=headers)#,body=urllib.urlencode(body))
    # print content.decode("gbk")

代码是随手写的,有点乱,见谅

转载于:https://www.cnblogs.com/taceywong/p/4867749.html

猜你喜欢

转载自blog.csdn.net/weixin_34159110/article/details/94197883