Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Hands-On Web Scraping with Python

You're reading from   Hands-On Web Scraping with Python Perform advanced scraping operations using various Python libraries and tools such as Selenium, Regex, and others

Arrow left icon
Product type Paperback
Published in Jul 2019
Publisher Packt
ISBN-13 9781789533392
Length 350 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Anish Chapagain Anish Chapagain
Author Profile Icon Anish Chapagain
Anish Chapagain
Arrow right icon
View More author details
Toc

Table of Contents (16) Chapters Close

Preface 1. Section 1: Introduction to Web Scraping FREE CHAPTER
2. Web Scraping Fundamentals 3. Section 2: Beginning Web Scraping
4. Python and the Web – Using urllib and Requests 5. Using LXML, XPath, and CSS Selectors 6. Scraping Using pyquery – a Python Library 7. Web Scraping Using Scrapy and Beautiful Soup 8. Section 3: Advanced Concepts
9. Working with Secure Web 10. Data Extraction Using Web-Based APIs 11. Using Selenium to Scrape the Web 12. Using Regex to Extract Data 13. Section 4: Conclusion
14. Next Steps 15. Other Books You May Enjoy

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 for this particular testing site, the values are visible, predefined, and provided—namely, Username = "admin&quot...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime