cURL / Mailing Lists / curl-users / Single Mail

curl-users

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

From: Hailu Meng <hailumeng_at_gmail.com>
Date: Wed, 22 Apr 2009 04:28:28 +0800

Thanks Linus,

I'm using PHP/CURL to do what I want to do. But for that webpage includes
one submit button. The html shows this button has no "value". html code only
has name/type/class and onclick properties. So how can I post this button
click action to the web server?

Thanks a lot!

Lou

<button name="sign-in-button" id="sign-in-button" class="amznButton"
type="submit" onclick="">

On Tue, Apr 21, 2009 at 5:01 PM, Linus Nielsen Feltzing <linus_at_haxx.se>wrote:

> 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_hometo 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&%2AVersion%2A=1&%2Aentries%2A=0><
>> 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&%2AVersion%2A=1&%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
>

-- 
Reach me at my SIP phone:
http://embed.grandcentral.com/webcall/235b378ed3c893205c5a5bd098d29ac5

-------------------------------------------------------------------
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