Questions that you might encounter when you post a Web page data with the Curl function and when the form submits a type of submit, with no Name and ID, and how to resolve it

Source: Internet
Author: User

The Curl function library implements the link of crawling Web content in http://www.cnblogs.com/linguanh/p/4292316.html

The following is a name and ID that is not identified by the

<input type= "Submit" value= "OnClick"/>

This type, after filling out the information, we generally need to click a button to trigger the commit event.

One of the variables that I described earlier in the article using curl to get a web cookie is to transfer past data,

This data is usually the website login account and password, corresponding to the input box name, below I give an example.

<input name= "UserName" id= "U" type= "text"/>

<input name= "PassWord" id= "P" type= "PassWord"/>

<input name= "Up" type= "Submit" value= "OnClick"/>

When we use a function to access its web page, the past data format may be

Username=123456&password=123&up=++%b5%c7%c2%bc++

How does this know?? First of all, we introduce you to a grab Bag tool, Firefox firebug, or other, is to grab the bag tool.

The above example is the simplest, in fact, if encountered I said <input type= "Submit" value= "OnClick"/>

This is the link to the action of its form because this is the real commit page, and then post username=123456&password=123 directly.

Ajax submissions, will be used to grab the package tool, crawl the source code, and then combined into data,post

Another situation is that there is a hidden input situation, what meaning, type= "hidden" This is not input, but we are using the Curl function to access the landing page

If you want to successfully go in, you need to send the input used, for the case of hidden, is also used to grab the package tool.

The final hint is, remember, the data transmission is urlencode encoded data, before the transmission, remember to encode, directly apply the Capture tool source code, no longer coded, it has helped you dry.

Questions that you might encounter when you post a Web page data with the Curl function and when the form submits a type of submit, with no Name and ID, and how to resolve it

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.