$ wget --recursive --no-clobber --page-requisites --html-extension --convert-links --restrict-file-names=windows --domains YourDomain.com --no-parent https://www.YourDomain.com/
Both --no-clobber
and --convert-links
were specified, only --convert-links
will be used.
Explanation of the options:
wget \
--recursive \
--no-clobber \
--page-requisites \
--html-extension \
--convert-links \
--restrict-file-names=windows \
--domains YourDomain.com \
--no-parent \
https://www.YourDomain.com/
--recursive
: download the entire Web site.
--domains YourDomain.com
: don’t follow links outside YourDomain.com.
--no-parent
: don’t follow links outside the directory /.
--page-requisites
: get all the elements that compose the page (images, CSS and so on).
--html-extension
: save files with the .html extension.
--convert-links
: convert links so that they work locally, off-line.
--restrict-file-names=windows
: modify filenames so that they will work in Windows as well.
--no-clobber
: don’t overwrite any existing files (used in case the download is interrupted and resumed).
This is a shorter version with slightly different settings:
wget -P /path/to/download -E -k -m -nH -np -p -c https://example.com
Explanation: -P
Set save directory path.-E
This option will cause the suitable suffix to be appended to the local filename.-k
After the download is complete, convert the links in the document to make them suitable for local viewing.-m
Turn on options suitable for mirroring.-nH
Disable generation of host-prefixed directories.-np
Do not ever ascend to the parent directory when retrieving recursively.-p
This option causes Wget to download all the files that are necessary to properly display a given HTML page.-c
Continue getting a partially-downloaded file.