Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1611893
  • 博文数量: 245
  • 博客积分: 10378
  • 博客等级: 上将
  • 技术积分: 2571
  • 用 户 组: 普通用户
  • 注册时间: 2009-03-27 08:19
文章分类

全部博文(245)

文章存档

2013年(4)

2012年(8)

2011年(13)

2010年(68)

2009年(152)

分类: Python/Ruby

2010-11-16 14:30:49

from urllib import request

count=range(0,255)
text=[]
file = open("e:\\1.txt","w")

for i in count:
    webfile=""+"%d"%i+".html"
    print("访问"+webfile+"\n")
    try:
        web=request.urlopen(webfile)
        web_html=web.read()
        text.append( "%s"%web_html)
        file.write("第%d个文件"%i+"文件名"+webfile+"\n")
        file.write(txt)
        file.write("写入结束 \n \n")
        web.close()
    except Exception:
        print("error \n")
        web.close()
        pass

file.close()
print("结束")

待续
挑战:

笨啊,

很简单: 2**38  直接访问这个页面即可过关

阅读(846) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~