python 批量获取公众号关注用户的openid

import requests,json
access_token='' 
next_openid='' #第一个拉取的OPENID,不填默认从头开始拉取 ,一次只能获取10000条
url='https://api.weixin.qq.com/cgi-bin/user/get?access_token=%s&next_openid'%(access_token,next_openid)
ans=requests.get(url)
a= json.loads(ans.content)['data']['openid'] 
print a,len(a)

 

你可能感兴趣的:(python 批量获取公众号关注用户的openid)