Writing XPath rules

In this part, we are going to create our XPath rules to parse the HTML document we will collect:

  • First of all, we will write XPath rules to collect information from the left-hand side of the web page, in other words, to collect information about how many articles there are for each categories.
  • Let's navigate the landing page of the website devveri.com. As we exercised in previous chapter, will use Google Developer Tools to create and test XPath rules. 
  • To use Google Developer Tools, we can right-click on an element, which we are interested in extracting data from.
  • Click Inspect Element. On the following screenshot, we marked the elements regarding categories:
Inspecting element using Google Developer Tools
  • Let's write ...

Get R Web Scraping Quick Start Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.