多线程请求乌云链接
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"))
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"))
相关文章推荐
- It's my life
- 开通51CTO博客,渐入佳境!
- 几个排序算法总结,从冒泡到快速排序
- 世界杯推动彩票APP爆发,谁将会笑到最后?
- 移动web开发规范
- html5 命运之轮生产
- 一步步解读《编写高质量代码》 js篇
- 垃圾回收基础知识
- 学习笔记-Javascript
- Linux 改变计算机名
- 论闭包中的变量是否都保存在内存中。
- 数星星
- 判别式模型与产生式模型解析(Discriminative Model vs. Generative Model)
- Kinect v2.0原理介绍之二:6种数据源
- cabal 2 alz is returning shortly
- 网上阅卷系统自动识别功能代码
- 学习笔记_Java get和post区别(转载_GET一般用于获取/查询资源信息,而POST一般用于更新资源信息)
- 简介Java程序的Shell脚本包装
- CUDA学习笔记(一)【转】
- 使用JQuery对checkbox及radio与select下拉单选赋默认值