Skip to content

Instantly share code, notes, and snippets.

@luxin88
Created May 3, 2017 02:10
Show Gist options
  • Save luxin88/a0d7b9c381fc970ade4f76c435bc49eb to your computer and use it in GitHub Desktop.
Save luxin88/a0d7b9c381fc970ade4f76c435bc49eb to your computer and use it in GitHub Desktop.
requests post数据
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import requests
allList = []
for i in range(1, 23):
listPayload = dict(action="loadvoteoptionbypage", guid="2cdb51ca-ef8a-f83d-9fc6-28341591d747",
tpldiyfile="viewvotewx.tpl", page=i)
r = requests.post(u'http://m138082.nofollow.ax.mvote.cn/op.php', data=listPayload)
item = r.json()
voteList = []
voteList.extend(item[u'retinfo'][u'list'][u'left'])
voteList.extend(item[u'retinfo'][u'list'][u'right'])
for user in voteList:
allList.append(user[u'pageurl'])
print allList
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment