"Python Network data Collection" The Nineth Chapter: cross-form and login window

Source: Internet
Author: User

1. Python Requests Library:

The requests library is a Python third-party library that specializes in handling complex HTTP requests, cookies, headers (response headers and request headers), and so on.

2. Submit a basic form:

1 ImportRequests2 3params = {'FirstName':'Ryan','LastName':'Mitchell'}4R=requests.post ("http://pythonscraping.com/files/processing.php", Data=params)5 6 Print(R.text)

Any POST request for the form actually occurs on this page, not the page on which the form itself is located. Remember: The purpose of the HTML form is simply to help visitors to the site send a reasonably formatted request to the server to request a page that does not appear. Unless you're studying the design style of the request, you don't need to spend too much time on the page where the form is located.

"Python Network data Collection" The Nineth Chapter: cross-form and login window

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.