cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Submit button can't be submitted by simply POST

From: Linus Nielsen Feltzing <linus_at_haxx.se>
Date: Tue, 21 Apr 2009 11:01:14 +0200

Hailu Meng wrote:
> Hi there,
>
> I'm new to curl and want to use curl to log in one website, click some
> links and then retrieve some information from the account. But when I used
> curl -d "email=xxx_at_gmail.com
> <mailto:xxx_at_gmail.com>&password=xxx&action=submit"
> https://sellercentral.amazon.com

Look here:

> <form action="https://sellercentral.amazon.com/gp/sign-in/sign-in.html/ref=xx_login_lgin_home" method="post" name="signin" onSubmit="changeOrgUnit()" >

This means that you have to send the request to
https://sellercentral.amazon.com/gp/sign-in/sign-in.html/ref=xx_login_lgin_home
to begin with.

Then you probably have to include the hidden fields as well:

> <input type="hidden" name="protocol" value="https" />
> <input type="hidden" name="action" value="sign-in" />
> <input type="hidden" name="destination" value="https://sellercentral.amazon.com/gp/homepage.html?ie=UTF8&amp;%2AVersion%2A=1&amp;%2Aentries%2A=0 <https://sellercentral.amazon.com/gp/homepage.html?ie=UTF8&amp;%2AVersion%2A=1&amp;%2Aentries%2A=0>" />
> <input type="hidden" name="optin" value="1" />
> <input type="hidden" id="ouid" name="ouid" value="01" />
> <input type="password" id="password" name="password" size="30" maxlength="20" />

You will most likely have to deal with session cookies as well, so you
should look up the -b and -c options.

Also read this, if you haven't already:
http://curl.haxx.se/docs/httpscripting.html

Good luck!

Linus
-------------------------------------------------------------------
List admin: http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2009-04-21