我的代码中有这个错误,我不知道如何消除它。代码将多个套接字连接到同一个服务器,但是我得到了这个错误
Traceback (most recent call last):
File "C:\Users\user\Desktop\file.py", line 73, in <module>
connect_to(target, port)
File "C:\Users\user\Desktop\file.py", line 68, in connect_to
int_nob.send("User-Agent: {}\r\n".format(random.choice(user_agents)).encode("utf-8"))
AttributeError: 'NoneType' object has no attribute 'send
受影响的代码部分
def connect_to(ip, port1):
int_nob = int(200)#num of bots
for x in range(0, int_nob):
print(int(int_nob))
int_nob -= 1
int_nob = s.connect((ip, port1))
int_nob.send("User-Agent: {}\r\n".format(random.choice(user_agents)).encode("utf-8"))
if int_nob == 0:
print(list_of_sockets)
print("resending sockets of " + int_nob)
while True:
connect_to(target, port)
我有所有的钱
import os
import random
s = socket.socket(AF_INET, socket.SOCK_STREM)
port = 445
等
我也不使用线程
目前没有回答
相关问题 更多 >
编程相关推荐