Python 利用Post请求(json数据)来刷注册

# -*- coding: utf-8 -*-
import requests
import random
print("请先输入网址,例如:http://www.xxxxx.com/index.php/index/register/\n")
url = input("请输入:")
print("\n请输入数量:")
num = int(input("\n"))
i = 1
while (i<=num):
    phonenum = random.choice(['139','188','185','136','158','151'])+"".join(random.choice("0123456789") for i in range(8))
    data = {
        "username": phonenum,
        "password": phonenum,
        "repassword": phonenum,
        "email": phonenum+"@qq.com",
        "name": phonenum,
        "country": phonenum,
        "address": phonenum,
        "zip": phonenum,
        "phone": phonenum,
    }

    res = requests.post(url=url, data=data)
    zi= "成功"
    result = zi in res.text
    i=i+1
    if result == True:
        print('yes')
最后修改:2020 年 07 月 22 日 08 : 22 PM
如果觉得我的文章对你有用,请随意赞赏