html_text_content: Extract text, title, description and language from HTML

View source: R/extract_text.R

html_text_contentR Documentation

Extract text, title, description and language from HTML

Description

Extract text, title, description and language from HTML

Usage

html_text_content(html)

Arguments

html

Raw HTML as a single string.

Value

A list with 'text' (cleaned, lowercased), 'title', 'description' and 'lang'. Missing elements are 'NA_character_'; 'text' is '""' when nothing could be extracted.

See Also

[page_signals()], which uses this to decide whether a page is classifiable.

Examples

html <- "<html lang='en'><head><title>Example</title>
  <meta name='description' content='A demo page'>
  <script>ignored()</script></head>
  <body><p>Hello   World</p><style>p{}</style></body></html>"
html_text_content(html)

rdomains documentation built on Aug. 2, 2026, 9:07 a.m.