html_text: Extract attributes, text and tag name from html.

Description Usage Arguments Value Examples

Description

Extract attributes, text and tag name from html.

Usage

1
2
3
4
5
6
7
8
9

Arguments

x

A document, node, or node set.

trim

If TRUE will trim leading and trailing spaces.

name

Name of attribute to retrieve.

default

A string used as a default value when the attribute does not exist in every node.

Value

html_attr, html_tag and html_text, a character vector; html_attrs, a list.

Examples

1
2
3
4
5
6
movie <- read_html("http://www.imdb.com/title/tt1490017/")
cast <- html_nodes(movie, "#titleCast span.itemprop")
html_text(cast)
html_name(cast)
html_attrs(cast)
html_attr(cast, "class")

Zyufei/Rstudy documentation built on May 19, 2019, 4:04 p.m.