In this section, we will learn about cookies and how we can use urllib and requests to get cookies when we are interacting with a site that supports identifying the user's action.
Handling HTTP Basic and Digest Authentication with requests
Introduction to authentication mechanisms
The authentication mechanisms supported natively in the HTTP protocol are HTTP basic and HTTP digest. Both mechanisms are supported in Python through the requests library. The HTTP Basic Authentication mechanism is based on forms and uses Base64 to encode the user composed with the password separated by a colon: user: password.
The HTTP Digest Authentication mechanism uses MD5 to encrypt the user, key, and realm hashes. The main difference between...