Get startedGet started for free

Simply the best!

Given the same HTML as in the previous exercise…

<html>
  <body>
    <div class="first section">
      A text with a <a href="#">link</a>.
    </div>
    <div class="second section">
      Some text with <a href="#">another link</a>.
      <div class="first paragraph">Some text.</div>
      <div class="second paragraph">Some more text.
        <div>...</div>
      </div>
    </div>
  </body>
</html>

…can you find a way to select the same three nodes as before, but with a much simpler selector?

The variable complicated_html has been prepared for you. It contains the HTML document with the above source code.

This exercise is part of the course

Web Scraping in R

View Course

Exercise instructions

  • Construct a simple selector that selects all three descendants of div.second.section.
  • This selector should only consist of exactly two div type selectors and a space, encompassing seven characters in total!

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

# Select the three divs with a simple selector
complicated_html %>%
	html_elements(___)
Edit and Run Code