wget after Cookie-login

Issues for wget

Step 1. Use Firebug to identify

  • form field names (e.g. user/name/password).
  • Hidden parameters
  • The target script name

Step 2. cut-n-paste from http://www.gnu.org/software/wget/manual/wget.html; Section –post-file=…

Procedure

# Log in to the server.  This can be done only once.
 wget
 --save-cookies cookies.txt
 --no-check-certificate
 --post-data 'user=foo&password=bar'
 http://server.com/auth.php
# Now grab the page or pages we care about.
 wget 
 --load-cookies cookies.txt
 -np -r
 -p http://server.com/interesting/article.php