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.
Diese Übung ist Teil des Kurses
Web Scraping in R
Anleitung zur Übung
- 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!
Interaktive Übung
Vervollständige den Beispielcode, um diese Übung erfolgreich abzuschließen.
# Select the three divs with a simple selector
complicated_html %>%
html_elements(___)