Get element children
Arguments
- x
A document (from
read_html()
), node set (fromhtml_elements()
), node (fromhtml_element()
), or session (fromsession()
).
Examples
html <- minimal_html("<ul><li>1<li>2<li>3</ul>")
ul <- html_elements(html, "ul")
html_children(ul)
#> {xml_nodeset (3)}
#> [1] <li>1</li>\n
#> [2] <li>2</li>\n
#> [3] <li>3</li>
html <- minimal_html("<p>Hello <b>Hadley</b><i>!</i>")
p <- html_elements(html, "p")
html_children(p)
#> {xml_nodeset (2)}
#> [1] <b>Hadley</b>
#> [2] <i>!</i>