getstu

#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')

 

你可能感兴趣的:(get)