cURL / Mailing Lists / curl-users / Single Mail

curl-users

How to use curl to manipulate the web message?

From: Alfred Zhang <alfredzhang83_at_gmail.com>
Date: Wed, 27 Jun 2012 09:55:02 +0800

Dear friends,

Good morning my frends, I am a fresh men for using curl , and I am very
glad to join curl-user mailing list.
I have a problem on how to post a form with "curl -d" , e.g. , asuming I
want to use Google to search a
key word "cat" , how can I use curl to make it?

The following html code is excerpt from Goole main page for china (
https://www.google.com.hk/).

*<form action="/search" id="tsf" method="GET" onsubmit="return q.value!=''"
role="search" name="f" style="display:block;background:none">
  <div id="tophf">
    <input type=hidden name=hl value="en">
    <input type=hidden name=newwindow value="1">
    <input type=hidden name=safe value="strict">
    <input type=hidden name=site value="">
    <input name="source" type="hidden" value="hp">
  </div>
  <div class="tsf-p" style="position:relative">
    <div class="nojsv" id="logocont"
style="left:0;position:absolute;padding:">
      <h1>
    <a id=logo href="https://www.google.com.hk/webhp?hl=en" title="Go to
Google Home">
      Google
      <img width=167 height=389 src="/images/nav_logo107.png" alt="">
    </a>
      </h1>
    </div>
    <div style="padding-bottom:2px;padding-top:1px">
      <table border="0" cellpadding="0" cellspacing="0" width="100%">
    <tr>
      <td width="100%">
        <table border="0" cellpadding="0" cellspacing="0" width="100%"
style="position:relative;border-bottom:1px solid transparent">
          <tr>
        <td class="lst-td" id="sftab" width="100%" style="border:0">
          <div class="lst-d lst-tbb">
            <input class="lst lst-tbb" value="" title="Search" size="41"
type="text" autocomplete="off" id="lst-ib" name="q" maxlength="2048">
            <span id="tsf-oq" style="display:none"></span>
          </div>
        </td>
        <td>
          <div class="nojsb">
            <div class="ds" id="sbds">
              <div class="lsbb kpbb" id="sblsbb">
            <button class="lsb" value="Search" type="submit" name="btnG">
              <span class="sbico"></span>
            </button>
              </div>
            </div>
          </div>
        </td>
          </tr>
        </table>
      </td>
      <td>
        <div class="nojsv" id="sfopt"
style="height:30px;position:relative">
          <div class="lsd"> </div>
        </div>
      </td>
    </tr>
    <tr>
      <td>
        <div id="pocs" style="display:none">
          <div id="pocs0">
        <span>
          <span>Google</span>
          Instant is unavailable. Press Enter to search.
        </span>
        <a
href="/support/websearch/bin/answer.py?answer=186645&amp;form=bb&amp;hl=en">Learn
more</a>
          </div>
          <div id="pocs1">
        <span>Google</span>
        Instant is off due to connection speed. Press Enter to search.
          </div>
          <div id="pocs2">
        Press Enter to search.
          </div>
        </div>
        <div id="pets"
style="color:#767676;display:none;font-size:9pt;margin:5px 0 0 8px">
          Press Enter to search.
        </div>
      </td>
    </tr>
      </table>
    </div>
    <div class="jsb" style="padding-top:2px">
      <center>
    <input value="Google Search" name="btnK" type="submit"
onclick="this.checked=1" />
    <input value="I'm Feeling Lucky" name="btnI" type="submit"
onclick="if(this.form.q.value)this.checked=1; else
top.location='/doodles/'" />
      </center>
    </div>
  </div>
</form> *

Give me a hand , please !

Alfred Zhang , Shanghai ,China.

-- 
我以为看到了曙光。。。。。。

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2012-06-27