View previous topic :: View next topic |
Author |
Message |
vert Apprentice
Joined: 07 May 2002 Posts: 214 Location: Delft, The Netherlands
|
Posted: Tue Apr 15, 2003 9:45 am Post subject: How to login to a website with WGET using the post method |
|
|
Does anybody know how to login to a website using wget? Every day I download a specific cartoon for which I have to login, and I figured this could be automated.
However, the website uses some kind of post method and I'm not familiair with those. See code below. Also, the webpage has a ".jsp" extension. Any thoughts on how to do this? Is it even possible?
Code: |
<form method="POST" action="/action" name="UserLogin">
<input type="hidden" name="action" value="login"/>
<input type="hidden" name="nextUri" value=""/>
...
<input type="text" name="userId" maxlength="30" size="15" value=""/>
<input type="password" name="password" maxlength="30" size="15" value=""/>
</form> |
|
|
Back to top |
|
|
Klavs Guru
Joined: 22 May 2002 Posts: 536 Location: Denmark
|
Posted: Tue Apr 15, 2003 10:22 am Post subject: |
|
|
I don't know if Wget can do it - but you can script lynx to do it.
use the -post_data option (RTFM and then -cmd_script to script what to select (ie. download/save/selected-name/quit).
Happy scripting and do post your results in the tips&tricks section when you get it working _________________ Best regards,
Klavs Klavsen
Denmark
Working with Unix is like wrestling a worthy opponent.
Working with windows is like attacking a small whining child
who is carrying a .38. |
|
Back to top |
|
|
TRauMa n00b
Joined: 26 Nov 2002 Posts: 43 Location: Germany
|
Posted: Tue Apr 15, 2003 10:22 am Post subject: |
|
|
Have you already tried GET? Some pages also accept this though normaly using POST. just try to fetch a url with http://bla.blubb/page.jsp?action=login&userId=vert&pass=secret
and see if that works.
If not: I dont think wget can handle post requests, though memory may serve me wrong here.
PS: The jsp extension is for Java Server Pages, thats just the language they're using (like .php etc.), but this info won't help you, I think |
|
Back to top |
|
|
vert Apprentice
Joined: 07 May 2002 Posts: 214 Location: Delft, The Netherlands
|
Posted: Tue Apr 15, 2003 10:53 am Post subject: |
|
|
I'll look into lynx, didn't know it supported scripting (yeah, i know, should rtfm ) The GET method didn't work (unfortunately) |
|
Back to top |
|
|
|