User authentication and cookies
User authentication (managing and handling user credentials) is another form of web security. In this section, we will use the user authentication feature available on the http://quotes.toscrape.com/login site, along with cookies.
As seen in Figure 6.6, http://quotes.toscrape.com/login contains a page with the Login text, and a form asking for Username and Password:
Figure 6.6: User login page
Analyzing the page source, there’s only a single <form>
element found, with one hidden
input element named csrf_token
, two text input elements with type="text"
(username
and password
), and finally, an object with the submit
type and the value Login
, as seen in Figure 6.7:
Figure 6.7: Login page – <form> source code
Important note
http://toscrape.com is a demo site, enriched with content for scraping-related purposes. The site does not provide a user registration...