DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Using Wget To Download Content Protected By Referer And Cookies

04.30.2007
| 56704 views |
  • submit to reddit
        1. get base url and save its cookies in file
2. get protected content using stored cookies

 $ wget --cookies=on --keep-session-cookies --save-cookies=cookie.txt http://first_page
 $ wget --referer=http://first_page --cookies=on --load-cookies=cookie.txt --keep-session-cookies --save-cookies=cookie.txt http://second_page