标签:http os sp on 文件 bs ad html ef
import urllib2,urllib,os
def Url1(url,files):#
try:
url=urllib2.urlopen(url)
except:
return ‘error‘
fp=file(files,‘w+‘)
fp1=url.read()
fp.write(fp1)
fp.close()
url.close()
url=‘https://docs.python.org/2.7/tutorial/index.html‘
Url1(url,r‘g:\\pic\%s.html‘%(url.endswith(‘html‘)))
标签:http os sp on 文件 bs ad html ef
原文地址:http://www.cnblogs.com/mhxy13867806343/p/4153444.html