Searching and Processing Web Documents
So far, we have learned about web scraping, data-finding techniques, and related technologies that help us with scraping, and we’ve identified a few reasons to select the Python programming language.
Web- or website-based content exists as HTML elements or as a predefined document or some kind of object (JSON). For extraction purposes, we need to analyze and identify such content, patterns, and objects. HTML-based elements are generally identified with XML Path (XPath) and Cascading Style Sheets (CSS) selectors, which are traversed and processed with scraping logic for the desired content. The lxml
library will be used in this chapter to process markup documents. We will be using browser-based Developer Tools (DevTools) for finding content and element identification.
In particular, we will learn about the following topics in this chapter:
- Introducing XPath and CSS selectors to process markup documents
- Using web browser...