您的位置:首页 > 其它

多线程请求乌云链接

2015-07-12 12:02 225 查看
#coding=utf-8
import requests
import threading
import time
print "start:" + (time.strftime("%H:%M:%S"))
def access():
for i in range(1,11):
url = 'http://drops.wooyun.org/papers/7049'
r = requests.get(url)
if r.status_code == 200:
print url
print i
#access()
threads = []
for i in xrange(5):
t = threading.Thread(target=access)
threads.append(t)
t.start()
t.join()#way2

# for i in xrange(7):
# t = threading.Thread(target=access)
# threads.append(t)

# for i in threads:
# i.start()

# for i in threads:
# i.join()

print"end:" + (time.strftime("%H:%M:%S"))
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: