Handling user authentication

In this section, we will be exploring a task that's used to process basic user authentication, which is available from http://testing-ground.scraping.pro/login. User authentication is often processed with a unique combination of information, such as username, password, email, and so on, to identify the user on the website.

The code in this section deals with logging in and changing the login credentials, as well as with obtaining the respective messages from the page.

As we can see in the following screenshot, the HTML <form> exists with two <input> boxes that accept the username and password (that is, the login credentials) that are required to login. Login credentials are private and secure information, but ...

Get Hands-On Web Scraping with Python now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.