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