Send post information only once with wget [error 405] [retreival]

Q: I try a site with a login with wget and post-data received, but a 405 error code .

The site does not use cookies to handle logging in the mirror, so I must pass my username / password using the – post-data option to the login script. This seems to work fine and it starts to mirror the page, but ends abruptly.

Here s an example of the headers wget :

r
– 0:54:05 – 977 503 = u003e “www.somesite.com / some / file.gif
Connecting to [xx.xx.xx.xx]: 80 . www.somesite.com connected.
HTTP request sent, awaiting response . HTTP/1.1 405 Method Not a 977.503 Allowed
Date 2: the Mon, 4/18/2005 6:16:02 GMT
3 Server: Apache/1.3.31 (Unix) mod_ssl/2.8.20 OpenSSL/0.9.7a mod_perl/1.29 PHP/4.3 .8
4 Allow: GET, HEAD, options, TRACE
5 Connection: 6 close
Content-Type: text / html; charset = iso-8859-1
00: 54:06 : Method Not Allowed.

Via google, I found the problem was probably related to the sending of post- data on each hit. So heres my question:

Is there any way to send the mail data string wget-only on the first page (login script) ?

Edit: clarity


Registry Error Cleaner
Re:Well, that would mean that you probably don't need to be logged in to get at the static data (like images). If you have a list of the files you want, can't you just put them in a text file and then have wget loop through and retrieved them all (or write a script to make wget do one at a time)?

Scan and Fix Errors in Windows Registry
Re:It's stores a server-side cookie, not a client side one. But I guess you can't really call it a server side cookie. It's just the session info made by PHP.

Edit: Missed this post sorry…

I'm just trying to understand how you're using wget differently to cause it to use a POST to grab an image…

Well I viewed the source and got the names for the login form (which is memberid for username, password, and action [which is login, this is a hidden field used commonly in server side scripts]). Then I want it to login with my user details by "faking" a form submit to the page that processes logins. The login page forwards me to my member page and I've given access to for-pay parts of the website.

Now I want wget to mirror everything it can find on the page [including member sections], but it only seems to do 1/20 of the content and then says it finishes.

I think the problem deals with when I tell wget to submit the form data to the login page, it does so, but then submits the login details to every page it tries to grab from the site. As a security measure the owners blocked POSTing data to a page that doesn't need it, so wget is denied access to most of the stuff.


ErrorSmart #1 Error Repair Tool
Re:Originally posted by: guy
Just stores the info on a server side cookie with my session id, I assume.
Now you're contradicting yourself. :P I'm pretty sure you can submit cookies using wget. You can "borrow" cookies from your regular browser.

Page-Cannot-Be-Displayed.net___PC Error Fixer___This is Not a Registry Cleaner, its Better!
Re:So wget actually parses an html file and submits a form based on the info in the html?

The only experience I have with it is one-offs from the commandline. Like:
wget
sends this out:
GET /i/authorsicons/crab.gif HTTP/1.0
User-Agent: Wget/1.8.2
Host: {$MySite}
Accept: */*
Connection: Keep-Alive

I'm just trying to understand how you're using wget differently to cause it to use a POST to grab an image…


Error Expert – Registry Repair
Re:Just stores the info on a server side cookie with my session id, I assume.

Nintendo Wii Fix Guide – Fix Wii Problems – Resolve Error Messages
Re:If the site doesn't use cookie(s), how does it track your session?

ErrorWiz – #1 Converting PC Registry Cleaner & Error Repair Software.
Re:Wget works the same way your web browser would work. It initiates a handshake with a webserver to send and receive data. All the information you fill out on a site in your webbrowser submits to the server the same way wget submits post-data (at least as much as the web server can see).

The bits and pieces sent to and from the server are nearly indistinguishable from program to program, the differences arise in the way the program manipulates the data.

Edit: spelling


Error Doctor 2008 New!! – **Super Affiliates Get Paid Bonuses!
Re:Forgive my lack of knowledge about wget, but I'll try to help. How did you get wget to do a POST in the first place?
It looks like static files can only be retrieved with GETs so if you have a list of such files you can just get wget to do a GET for those (sorry, couldn't resist :P ).

Related posts

Leave a comment

0 Comments.

Leave a Reply


click to changeSecurity Code

[ Ctrl + Enter ]