原文地址:
http://www.linuxjournal.com/content/downloading-entire-web-site-wget
也許你曾需要下載整個站點,比如是想離線瀏覽其內容,wget可以完成這項工作。比如:
$ wget \
--recursive \
--no-clobber \
--page-requisites \
--html-extension \
--convert-links \
--restrict-file-names=windows \
--domains website.org \
--no-parent \
www.website.org/tutorials/html/
這條命令將把站點www.website.org/tutorials/html全部下載下來。
命令解釋:
--recursive 遞歸下載整個站點
--no-clobber 不要覆蓋已有文件(以防下載被中斷而重新開始)
--domains website.org 不要下載website.org以外的鏈接地址
--no-parent 不要下載tutorials/html目錄之外的內容
--page-requisites 下載所有頁面需要的元素(圖像、CSS等等)
--html-extention 只下載html相關的文件
--convert-links 轉換鏈接地址,從而本地離線可以正常訪問
--restrict-file-names=windows 修改文件名以使文件也可以在windows下訪問(某些情況文件名在Linux下合法而在windows下非法)。