tags:

views:

2010

answers:

2

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

+1  A: 

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.

ceejayoz
I dont have access to change anything on the server, it is read only
Steven1350
So? None of this requires you to change anything on the server.
ceejayoz
+5  A: 

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)

jarnoan