Extract attributes, text and tag name from html.
html_text(x, trim = FALSE) html_name(x) html_children(x) html_attrs(x) html_attr(x, name, default = NA_character_)
| x | A document, node, or node set. |
|---|---|
| trim | If |
| name | Name of attribute to retrieve. |
| default | A string used as a default value when the attribute does not exist in every node. |
html_attr, html_tag and html_text, a character
vector; html_attrs, a list.
movie <- read_html("http://www.imdb.com/title/tt1490017/") cast <- html_nodes(movie, "#titleCast span.itemprop") html_text(cast)#> character(0)html_name(cast)#> character(0)html_attrs(cast)#> list()html_attr(cast, "class")#> character(0)