In this part, we are going to focus on hands-on exercises about XPath rules. We will start with matching some XML nodes and attributes on Packt's website. We will use the Google Chrome Developers Tool.
Let's get started:
- Navigate to Packt's web site and open Google Chrome's Developers Tool.
- When you open this tool, you will see the following screen:
- To write XPath rules, the console should be used, and the XPath rules should be written as shown: $x('//*[@id="menu-books"]') .
- If we run this XPath rule, we will get the results shown in the following screenshot: