yyyyyyyyyyyyyyyyyyyy

博客园 首页 新随笔 联系 订阅 管理
#coding: utf-8
#title..href...
import urllib.request
import time

url=['']*230
page=15564
j=0
while j<230:
    url[j]='http://www.chinacampus.org/show.php?contentid='+str(page)
    content=urllib.request.urlopen(url[j]).read().decode('utf-8', 'replace')
    open(r'stu/'+str(page)+'.html','w+',encoding='utf-8').write(content)
    print('donwloading ',j,' page:',url[j])
    j=j+1
    page=page+1
    time.sleep(5)
else:    
    print('download article finished')

 

posted on 2015-04-08 00:02  xxxxxxxx1x2xxxxxxx  阅读(176)  评论(0)    收藏  举报