python 批量请求url
2024-10-13 15:13:26
import urllib2
from urllib import quote f = open("data.in", "r")
out = file("data2.out","w+")
a = 1.0
for line in f:
#print line
stri = quote(line)
url ='*******'+stri
#print url
try:
data = urllib2.urlopen(url)
except:
date = 'error'
no = str(a)
out.writelines(no+' '+ data.read()) a = a+ 1
if (a%1000==0):
print a
#print data.read() f.close() out.close()
最新文章
- Tomcat 中响应头信息(Http Response Header) Content-Length 和 Transfer-Encoding
- scikit-learn使用笔记与sign prediction简单小结
- MySQL数据库(表)的导入导出(备份和还原)
- oracle根据视图删除表
- [WPF实用技巧]如何使WPF的TreeView节点之间有连线
- hdu 3658 How many words
- htmlcleaner
- jQuery Mobile 控制 select 的显示隐藏 display none
- 初涉JavaScript模式 (12) : 沙箱模式
- 选择一个利于SEO的空间
- eclipse 导入 Maven 多模块项目
- js数据显示在文本框中(页面加载显示和按钮触动显示)
- TPS及计算方法
- Node.js学习笔记(一)基础介绍
- webstorm 编辑器破解 (麻麻再也不用担心过期了)
- Android为TV端助力 反编译
- JAVA9大隐式对象
- Confluence 6 MySQL 测试你的数据库连接
- abaqus查询网格相关
- iOS开发-- Xcode 6单元测试