I am trying to use wget to download a page, but I cannot get past the login screen.
How to I send the username/password using post data
thanks
I am trying to use wget to download a page, but I cannot get past the login screen.
How to I send the username/password using post data
thanks
If they're using basic authentication:
wget http://username:[email protected]/page.html
If they're using POSTed form data, you'll need to use something like cURL instead.
From the manual page:
# Log in to the server. This can be done only once.
wget --save-cookies cookies.txt \
--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 \
-p http://server.com/interesting/article.php
You probably need to add --keep-session-cookies parameter as well.
(This topic would be probably more suited to superuser.com)