大家好,我的剧本有问题。 基本上,它不创建任何帐户,也不会将它们写入我的.txt文件(当我打开它时,它是空的),但它会打印电子邮件和密码。 你能帮帮我吗? 我希望有一些工作帐户和阅读他们在我的.txt文件 希望你能帮助我,提前谢谢 注:数据生成是一个包含post请求(注册)信息的dict
times = int(input("[" + (time.strftime("%H:%M:%S") + "]" + " - How many accounts?: ")))
Nome_completo = "testname"
Nome = Nome_completo.split()[0]
email = "test+{}@gmail.com".format(getrandbits(8))
Giorno_compleanno = random.randint(10, 27)
Mese_compleanno = random.randint(0, 12)
Anno = random.randint(1982, 2003)
Data_completa = str(str(Giorno_compleanno) + "/" + str(Mese_compleanno) + "/" + str(Anno))
password_1 = "test_1234"
s = requests.session()
r_1 = s.get(awlab_url,headers=headers)
r = s.get(url, headers=headers)
text_file = open("awlabaccounts", "r+")
def create():
global email
global password_1
if str(200) in str(r.status_code):
text_file.write(email + ":" + password_1 + "\n")
print("Accounts successfully created!")
else:
print("ERROR!")
reg = s.post(url_post, data=data_gen, headers=headers)
for i in range(times):
create()
您需要在代码末尾关闭文本文件。你知道吗
相关问题 更多 >
编程相关推荐