html_name: Get element name

View source: R/html.R

html_nameR Documentation

Get element name

Description

Get element name

Usage

html_name(x)

Arguments

x

A document (from read_html()), node set (from html_elements()), node (from html_element()), or session (from session()).

Value

A character vector the same length as x

Examples

url <- "https://rvest.tidyverse.org/articles/starwars.html"
html <- read_html(url)

html %>%
  html_element("div") %>%
  html_children() %>%
  html_name()

rvest documentation built on June 22, 2024, 10:47 a.m.