URL就不贴出来了 base_url = ‘......’ with open('../机器人/phone.txt', 'r') as f: for i in f: # print(i.strip()) z = i.strip() payload = { 'phone' : z, 'verify' : '787878' } r = requests.post(base_url,data=payload) r1 = r.json() with open("token.txt", 'a', encoding='utf-8') as f: f.write(r1['data']['token'] + '\n')
目的是通过手机号码获取token,手机号码5W个,每行读取后,POST请求,最后把只需要的token,保存到txt文件中