Use wget to download websites that require cookie authentication

Source: Internet
Author: User

1, using Firefox, installingExport CookiesPlugins

2 , login website, point menu"Tools-Export Cookies :", SaveCookies.txtto your own folder

3 , theCookies.txtChange the file name to cookie.txt

4 , open the terminal into your own folder, enter the command:

wget--referer=http://192.168.1.250--cookies=on--load-cookies=cookie.txt - -keep-session-cookies--save-cookies=cookie.txt http://192.168.1.250/space-1461-do-album-id-109.html

?

?

wget-r-p-np-k? http://xxx.com/xxx

- R,?--Recursive (Recursive)????????? Specify recursive download.(Specify recursive download)
- k,?--Convert-links (convert link)????? Make links in downloaded HTML point to local files.(The downloadedHTMLlinks in the page are converted to relative links as local links)
- P,?--page-requisites (page required element)??? get all images, etc. needed to display HTML page.(Download all images and other pages to display the desired content)
-NP,--no-parent (does not go back to the parent) ????????? don ' t ascend to the parent directory.

In addition, the breakpoint continues to be transmitted with-NCParametersLogwith- oParameters

- CBreakpoint Continuation
- R Download all files in a directory (including subdirectories) of a specified Web page recursively
-nd recursive download does not create a layer of directories, all files are downloaded to the current directory
-NP recursive download does not search the upper directory, such asWget-c-R? www.xxx.org/pub/path/
no parameter added-NP, it will be downloaded at the same timePaththe upper level of the directoryPubother documents under the
- k The absolute link to a relative link, download the entire site and browse the Web offline, it is better to add this parameter
- L do not enter other hosts at the time of recursion, such as wget-c-r? www.xxx.org/?
If there is one such link in the site:?
www.yyy.org , without parameters- L, it will be downloaded as if it were a fire-burning mountain.www.yyy.org website
- P all files, tablets, etc. required to download the webpage
-A specifies a list of file styles to download, with multiple styles separated by commas
- I. followed by a file that indicates the file to be downloaded in the URL

Use wget to download websites that require cookie authentication

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.