Last active
September 15, 2017 18:43
-
-
Save DoubleShift/16d2bf402d82aef8cd4f8f7aa5fcf169 to your computer and use it in GitHub Desktop.
扫电信校友卡号
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import requests | |
import json | |
base_url = "http://fx.sh.189.cn/mininet/wapQcxy/queryNumberPage/3474/" | |
headers = { "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8", | |
"User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36", | |
"Referer":"http://fx.sh.189.cn/mininet/wapQcxy/appointPickSubmit.html", | |
"Accept-Encoding":"gzip, deflate", | |
"Accept-Language":"zh-CN,zh;q=0.8" | |
} | |
def getNums(searchhd,searchnum,pagenum): | |
#searchhd = 180 or 177,searchnum = 0~9999 | |
payload = {'searchhd':searchhd,'searchnum':searchnum,'payType':1,'groupWorkNo':18918101133} | |
r = requests.post(base_url + pagenum,data = payload,headers = headers) | |
return json.loads(r.text) | |
page = 1 | |
while(True): | |
array = getNums('180','',str(page)) | |
if array: | |
for x in array: | |
print(x['numberName']) | |
page+=1 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment