Using Wget to save pages that require logging in?


I've been trying to archive my forum private messages using Wget (its a custom forum server, so i cant just click "export all messages" like you can in phpbb). As a result, they're stuck behind a login page.

This is what I've tried (with username and password taken out for obvious reasons):

wget --save-cookies cookies.txt --keep-session-cookies --post-data 'user_session_name=foo&user_session_password=bar'
wget --load-cookies cookies.txt --keep-session-cookies -k -p -m -E -np --output-file=log.txt

The login page is and the page I want to archive is (you can't go to this page because you need to be logged in).

It doesn't save the actual page I want, it just redirects to the login page. Am I doing something wrong here?

Tamara Macadam

Posted 2013-09-07T04:14:13.387

Reputation: 63

No answers