[Linux, Windows] Use wget to download the entire website, specific directories, and specified file types

888u

Last update at :2024-07-08,Edit by888u

1. Use of wget

Download all files in a directory: wget -c -r -np -k -L -p www.xxx.xxx/pub/path/

If you use images or links from external domain names, you must add the -H parameter: wget -np -nH -r --span-hosts www.xxx.xxx/pub/path/

The parameters are explained as follows:

-c Resumes download from breakpoint -r downloads recursively, downloading all files in a directory (including subdirectories) of the specified web page -np does not search the upper directory when downloading recursively. For example, wget -c -r www.xxx.xxx/pub/path/ without adding the parameter -np will download other files in the upper directory pub of path at the same time. -k Convert absolute links to relative links. Download the entire site and browse the web offline. It is best to add this parameter. -L does not enter other hosts during recursion -p downloads all files required for the web page, such as pictures, etc. -nH, –no-host-directories Do not create host directories -H, --span-hosts when recursing go to external hosts –accept=LIST Acceptable file types (LIST replaced with file suffix) –reject=LIST Reject file types (LIST replaced with file suffix)

2. Using wget under Windows

wget is a tool under Linux, you can use it directly. Here's how to use wget under Windows.

1. Download WGET for Windows: wgetwin-1_5_3_1-binary.zip 2. Unzip to a directory such as D:\wget 3. Add the wget environment variable, which will be more convenient to use. Right-click Computer->Properties->Advanced System Settings->Advanced->Environment Variables->Select PATH->Edit, and add at the end; D:\wget (actual decompression path) 4. Complete.

Recommended site searches: high-defense server rental, IP purchase, how much does it cost to rent a server for a year, free external server, cloud server, domain name transfer, US host reviews, php website space, Hong Kong high-defense server rental, virtual space Purchase,

[Linux, Windows] Use wget to download the entire website, specific directories, and specified file types

All copyrights belong to 888u unless special state
取消
微信二维码
微信二维码
支付宝二维码