html_meta: Meta tags

View source: R/metadata.R

html_metaR Documentation

Meta tags

Description

One row per ⁠<meta>⁠ element below the given nodes (and the nodes themselves), in document order. Duplicates are kept, so OpenGraph (⁠og:*⁠ in property), Twitter cards and Dublin Core (name) come out as rows to filter.

Usage

html_meta(x)

Arguments

x

A zuhtml_document or zuhtml_nodeset.

Value

A data frame with character columns name, property, http_equiv, charset and content, each the attribute as written (decoded) or NA when absent. name, property and http_equiv keep their case; compare with tolower().

See Also

Other metadata: html_json_ld(), html_microdata(), html_title()

Examples

doc <- html_parse(paste0(
  "<meta charset='utf-8'>",
  "<meta name='description' content='A page.'>",
  "<meta property='og:title' content='Title'>",
  "<meta property='og:image' content='a.png'>",
  "<meta property='og:image' content='b.png'>"
))
meta <- html_meta(doc)
meta
meta$content[meta$property %in% "og:image"]

zuhtml documentation built on Oct. 6, 2026, 5:06 p.m.