You can see how using a structured query language makes searching for, and retrieving, information much easier than basic string searches. However, XPath was designed for generic XML documents, not HTML. There is another structured query language that is made specifically for HTML. Cascading Style Sheets (CSS) were created to provide a way to add stylistic elements to HTML pages. In a CSS file, you would define a path to an element or multiple elements, and what describes the appearance. The definitions for the path to the element are called CSS selectors and are written specifically for HTML documents.
CSS selectors understand common attributes that we could use in searching HTML documents. In the previous XPath examples, we often used a query such as div[@class="some-class"] in order to search for elements with the class...