# -*- coding: utf-8 -*- import random import os, threading, datetime import requests, json def createPhone(): prelist = ["130", "131", "132", "133", "134", "135", "136", "137", "138", "139", "147", "150", "151", "152", "153", "155", "156", "157", "158", "159", "186", "187", "188", "189"] new_phone = random.choice(prelist) + "".join(random.choice("0123456789") for i in range(8)) # print(new_phone) return new_phone def req_thread(url,params): headers = {"User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1",‘Content-Type‘:‘application/json;charset=UTF-8‘ ,"Accept": "application/json, text/plain, */*"} print(params) r = requests.post(url, params=params, headers=headers,data=params); print(r.text) def teThread(): st = datetime.datetime.now() phone = createPhone() url = "http://域名+ 路径" params = {"phone": phone} data = json.dumps(params) m = threading.Thread(target=req_thread(url,data), args=()) m.run() end = datetime.datetime.now() if __name__ == ‘__main__‘: teThread()
?
原文:https://blog.51cto.com/u_11639179/3309240