一键下载网站资源(html/css/js/fonts)

有时看到一个漂亮的模版,就想把它弄下来研究研究,利用系统wget就能轻松搞定,一键把网站的相关资源下载,并在本地做个镜像。

一键下载网站资源

$ wget \
     --recursive \
     --no-clobber \
     --page-requisites \
     --html-extension \
     --convert-links \
     --restrict-file-names=windows \
     --domains website.org \
     --no-parent \
         https://www.website.org/tutorials/

相关参数:

  • --recursive: 下载整个网站
  • --domains website.org: 只下载域名website.org的资源
  • --no-parent: 不下载父级路径
  • --page-requisites: 下载页面里包含的所有元素 (images, css 等)
  • --html-extension: 以 .html后缀名保存
  • --convert-links: 改变页面链接,以能在本地离线浏览
  • --restrict-file-names=windows: 修改文件名,以便它们也可以在Windows中运行
  • --no-clobber: 不要覆盖任何现有文件(用于下载中断和恢复的情况)。
posted @ 2020-09-06 16:59  笠航  阅读(1434)  评论(0编辑  收藏  举报