Summary
In this chapter, we learned about DOM navigation, XPath, and CSS selectors using the page source and DevTools. We also learned about reading and accessing XML and HTML files and defining and using XPath and CSS selector expressions for content extraction.
We also looked at various aspects of content extraction, plus the benefits and restrictions imposed by robots.txt
and sitemaps. The main objective of the chapter was to demonstrate core features related to nodes, element identification from HTTP responses received, using the lxml
and urllib
libraries as required, and dealing with XML and HTML files. Finally, web scraping techniques were deployed using an example and data was collected and written to a CSV file.
In the next chapter, we will learn more about web scraping techniques and about some new Python libraries.