返回信息流各位大神求指导,困扰了好几天,就是这个网站http://www.iiyi.com/
postData = {'username' : 'zzdaye@163.com', ###你的用户名
'password' : 'xxxx', ###你的密码
'auto' : '0',
'vcode':'',
}
headers = {
'Accept':'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',
'Accept-Encoding':'gzip, deflate, sdch',
'Accept-Language':'zh-CN,zh;q=0.8',
'Cookie':'cnaday_auth_visit=f92747b31d48d18d76a6740d45da1020; CNZZDATA30049871=cnzz_eid%3D969359211-1439954392-http%253A%252F%252Fiapi.iiyi.com%252F%26ntime%3D1440377229; CNZZDATA30080017=cnzz_eid%3D1280405677-1439955491-http%253A%252F%252Fiapi.iiyi.com%252F%26ntime%3D1440378214; __utma=1.881348118.1439959673.1440148394.1440379536.10; __utmb=1.1.10.1440379536; __utmc=1; __utmz=1.1440379536.10.10.utmcsr=iapi.iiyi.com|utmccn=(referral)|utmcmd=referral|utmcct=/v1/tnav; Hm_lvt_f6462c453d025b6235ffc49efab63e1e=1439965661,1440051563,1440142571,1440341373; Hm_lpvt_f6462c453d025b6235ffc49efab63e1e=1440379536; auth_auto=eb91D55fosxgVGs0%2BK22Se4qfMiWh4AN3QD6%2FzcLxwiSQpjexJmBomJmN7I6EseUqIoxoM4',
'Host':'auth.iiyi.com',
'If-Modified-Since':'Mon, 24 Aug 2015 01:25:32 GMT',
'Proxy-Connection':'keep-alive',
'Referer':'http://iapi.iiyi.com/v1/tnav?site=mh&0.7480784514918923&op=logout&referer=http%3A%2F%2Fwww.iiyi.com%2F',
'Upgrade-Insecure-Requests':'1',
'User-Agent':'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.155 Safari/537.36',
}
posturl = 'http://auth.iiyi.com/?referer=http%3A%2F%2Fwww.iiyi.com%2F'
cookie_support = urllib2.HTTPCookieProcessor(cj)
opener = urllib2.build_opener(cookie_support, urllib2.HTTPHandler)
urllib2.install_opener(opener)
请问还需要哪些数据才能模拟登录
这是一条镜像帖。来源:北邮人论坛 / python / #8357同步于 2015/8/27
该镜像源已超过 30 天没有更新,可能在源站已被删除。
Python机器人发帖
python爬虫模拟登录问题
gz19930731
2015/8/27镜像同步6 回复
订阅后,新回复会通过你的通知中心匿名送达。
6 条回复
request返回的是<urllib2.Request instance at 0x000000000337B848>
【 在 trouvan 的大作中提到: 】
: 无法登陆时网页返回的是什么?
抓了一下包,post_url应该是http://auth.iiyi.com/login/do吧,你是怎么得到你那个post_url的
另外你贴上<urllib2.Request instance at 0x000000000337B848>叫人怎么帮你看.....
至少要贴出返回的html啥的
PY2不清楚,py3返回实例后还要read一下,应该差不多
【 在 gz19930731 的大作中提到: 】
: request返回的是<urllib2.Request instance at 0x000000000337B848>