Using wget under Windows

Source: Internet
Author: User

  The GNU Wget is a free, open source Web download tool that supports the HTTP,HTTPS and FTP protocols, is powerful and easy to use, and allows you to easily and reliably download large files from the Internet or mirror copies of the entire site. The software was originally run under Linux, but now also has the Windows version, the use is similar, this article discusses in the Windows environment wget use.

  1 Getting wget for Windows

https://eternallybored.org/misc/wget/

2 Running wget under Windows

Open cmd into the downloaded wget directory, enter the command line can run wget, the syntax is:

wget [option] ... [URL] ...

Enter Wget-v here to see the version information:

3 Download the entire site

Wget-c-k-r-np-p http://Www.yoursite.com/path

-C,--continue breakpoint download

-K,--convert-links links the page to a local

-R,--recursive specified directory recursive download

-NP,--no-parent not download the parent directory

-p,--page-requisites download page request element

For example, execute "wget-c-k-r-np-p http://www.w3school.com.cn/json/", you can download the entire W3cschool JSON tutorial, after the download is complete, cmd will be prompted, You can find the website you just downloaded in the wget directory:

4 Breakpoint Continuation and retry

The power of wget is that it can maintain a stable download in the case of limited local bandwidth or unstable network, and if for some reason the download task is disconnected, wget will continue to attempt to resume the download until the entire file is downloaded, which is useful for downloading files from sites with download restrictions.

The operation parameter that implements the continuation of the breakpoint is "-C", and if you need to limit the number of retries, add the "-T" parameter, such as a limit of 5 retry attempts, plus "-t 5".

  

5 Bulk Downloads

The operation parameter to be used here is "-I":

-I--input-file=file download links in local or external files.

If you want to download more files, you can create a new text document such as Download.txt, the URL to download a line into the document, and then the command line to execute "wget-i download.txt".

6 wget various options category List

Run the command line "Wget-help" to display the various options parameters of wget, which are sorted out for easy reference:

*Start-v,–version Show wget version and Exit-h,–help Print Syntax help-b,–background boot to background execution-e,–execute=command execute '. Wgetrc ' Format command, WGETRC format see/ETC/WGETRC or ~/.WGETRC
*record and input files-o,–output-file=File writes records to file-a,–append-output=File appends records to file-d,–debug Print Debug Output-q,–quiet Quiet mode (no output)-v,–verbose Verbose mode (this is the default setting)-nv,–non-verbose turn off verbose mode, but not quiet mode-i,–input-file=file download URLs that appear in file files-f,–force-HTML treats the input file as an HTML format file-b,–base=url the URL as the-f-The i parameter specifies the prefix of the relative link that appears in the file –sslcertfile=FILE Optional client certificate –sslcertkey=keyfile Optional client certificate Keyfile–egd-file=File Specifies the file name of the EGD socket
*Download –bind-address=address specifies local use of addresses (host name or IP, used when there are multiple IPs or names locally)-t,–tries=number Set Maximum attempted link count (0indicates no limit). -o–output-document=File writes the document to file-nc,–no-clobber do not overwrite existing files or use. #前缀-c,–Continuethen download the files that are not finished –progress=TYPE Set Process bar tag-n,–timestamping do not download files again unless newer than local files-s,–server-Response Print server response –spider not download anything-t,–timeout=SECONDS Setting the number of seconds for response timeout-w,–wait=SECONDS interval between two attempts SECONDS seconds –waitretry=SECONDS wait between Relink 1 ... Seconds sec –random-wait wait between downloads 0 ... *Wait seconds-y,–proxy=on/off turn agent on or off-q,–quota=Number set the download capacity limit –limit-rate=Rate Limit Download transmission

*Catalogue-nd–no-directories do not create a directory-x,–force-directories forcing a directory to be created-nh,–no-host-directories do not create a host directory-p,–directory-prefix=prefix Save the file to the directory prefix/...–cut-dirs=Number ignores number layer remote directory

*HTTP Option –http-user=User sets the HTTP username to username. –http-passwd=Pass sets the HTTP password to pass. -c,–cache=on/off Allow/server-side data caching is not allowed (generally allowed). -e,–html-extension Save all text/html documents with an. html extension –ignore-length ignore ' content-Length ' header field –header=String inserts strings in headers String–proxy-user=User Setting Agent username is User–proxy-passwd=the password for the PASS setting agent is Pass–referer=URL contains ' referer:url ' header in HTTP request-s,–save-headers Saving HTTP headers to a file-u,–user-agent=agent the name of the proxy is agent instead of wget/version. –no-http-keep-Alive Close the HTTP activity link (forever link). –cookies=off do not use cookies. –load-cookies=File loads the cookie–save from the filename before starting the session-cookies=file saves the cookie to the file at the end of the session

*FTP Options-nr,–dont-remove-listing do not remove '. Listing ' files-g,–glob=on/off globbing mechanism for opening or closing filenames –passive-FTP uses passive transfer mode (default). –active-FTP uses active transfer mode –RETR-Symlinks the link to the file (not the directory) at the time of recursion

*Recursive Download-r,–recursive recursive download--use with caution! -l,–level=number maximum recursion depth (INF or 0represents Infinity). –Delete-after the file is deleted locally after it is finished-k,–convert-Links Convert non-relative links to relative links-k,–backup-converted back to X.orig before converting file X-m,–mirror equivalent to-r-n-l INF-Nr. -p,–page-requisites Download all pictures showing HTML files

* Included and not included in the recursive download (accept/reject)-a,–accept=List of accepted extensions separated by the list semicolon-r,–reject=List of non-accepted extensions separated by the list semicolon-d,–domains=List of accepted domains separated by the list semicolon –exclude-domains=List of non-accepted domains separated by the list semicolon –follow-FTP tracking for FTP links in HTML documents –follow-tags=List of tracked HTML tags separated by the list semicolon-g,–ignore-tags=list of ignored HTML tags separated by the list semicolon-h,–span-hosts go to external host when recursion-l,–relative only tracks relative links-i,–include-directories=List of allowed directories-x,–exclude-directories=List of directories that are not included-np,–no-parent does not go back to the parents directory-s,–spider URL does not download only the display process

Reference Blog: http://www.ha97.com/153.html

(The source of this article--http://www.cnblogs.com/zeakhold/)

Using wget under Windows

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.