cURL / Mailing Lists / curl-users / Single Mail

curl-users

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

From: Ralph Mitchell <ralphmitchell_at_gmail.com>
Date: Tue, 21 Apr 2009 15:46:48 -0500

On Tue, Apr 21, 2009 at 3:28 PM, Hailu Meng <hailumeng_at_gmail.com> wrote:

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

 Firstly, please don't top-post. It makes it difficult to follow an email
thread.

Secondly, you can send an empty variable. For example, using the command
line tool, you would do this:

     curl -d sign-in-button= ---

Thirdly, you need to see what the "onSubmit" function does, because those
have been known to modify the contents of the form before the submit is
performed.

You should probably load LiveHTTPHeaders into Firefox and see what an actual
browser really sends to the server when you visit it.

Ralph Mitchell

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

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