直接在浏览器中打开博客园的文件,可能会有乱码的内容。

用Python脚本可以将别人博客园的文件下载到本地,下面是个例子:

import urllib,re
url = "http://cdn.bootcss.com/bootstrap/3.2.0/js/bootstrap.min.js"
names = url.split('/')
name = names[len(names)-1]
wp = urllib.urlopen(url)
content = wp.read()
path = 'C:/Users/bjlantianyou/Desktop/'+name
f = file(path,'w+')
f.write(content)
f.close()

其中“url”是文件所在的url,“path”是保存到本地路径的文件名。

相关文章:

  • 2021-05-28
  • 2022-12-23
  • 2021-12-07
  • 2021-12-21
  • 2022-01-09
  • 2021-09-30
  • 2021-09-03
  • 2021-12-14
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-06-20
  • 2021-08-29
  • 2021-12-21
  • 2021-06-19
相关资源
相似解决方案