Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How to login to a website with WGET using the post method
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
vert
Apprentice
Apprentice


Joined: 07 May 2002
Posts: 214
Location: Delft, The Netherlands

PostPosted: Tue Apr 15, 2003 9:45 am    Post subject: How to login to a website with WGET using the post method Reply with quote

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. 8)
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
View user's profile Send private message
Klavs
Guru
Guru


Joined: 22 May 2002
Posts: 536
Location: Denmark

PostPosted: Tue Apr 15, 2003 10:22 am    Post subject: Reply with quote

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
View user's profile Send private message
TRauMa
n00b
n00b


Joined: 26 Nov 2002
Posts: 43
Location: Germany

PostPosted: Tue Apr 15, 2003 10:22 am    Post subject: Reply with quote

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
View user's profile Send private message
vert
Apprentice
Apprentice


Joined: 07 May 2002
Posts: 214
Location: Delft, The Netherlands

PostPosted: Tue Apr 15, 2003 10:53 am    Post subject: Reply with quote

I'll look into lynx, didn't know it supported scripting (yeah, i know, should rtfm :wink: ) The GET method didn't work (unfortunately)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum