#地震思考录
#coding:utf-8
import urllib
import time
url=[’’]*40
con=urllib.urlopen(‘http://blog.sina.com.cn/s/articlelist_1191258123_0_1.html’).read()
title=con.find(r’<a title=’)
herf=con.find(r’href=’,title)
i=0
html=con.find(r’.html’,herf)
while title!=-1 and herf!=-1 and html!=-1 and title < len(con) and i<40:
url[i]=con[herf+6:html+5]
print url[i]
title=con.find(r’<a title=’,title)
herf=con.find(r'href=',title)
html=con.find(r'.html',herf)
title=herf
i=i+1
else:
print ‘find end’
#以上捕获文章的地址
while j<50:
content=urllib.uropen(url[j]).read()
open(r’hanhan/’+url[j][-26:]),‘w+’).write(conte