有時看到一個漂亮的模版,就想把它弄下來研究研究,利用系統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: 不要覆蓋任何現有文件(用於下載中斷和恢復的情況)。