remove_html {postlightmercury}R Documentation

Removes html

Description

The function uses tools from the rvest and xml2 packages to clean up the HTML and turning it into proper text.

Usage

remove_html(strings, trim = TRUE)

Arguments

strings

the string(s) you want to clean

trim

should the string be trimmed or not

Value

a string

Examples

## Not run: 
# First get api key here: https://mercury.postlight.com/web-parser/

# Then run the code below replacing the X's wih your api key.
url <- "https://trackchanges.postlight.com/building-awesome-cms-f034344d8ed"
my_data <- web_parser(page_urls = url,
                      api_key = XXXXXXXXXXXXXXXXXXXXXXX)

# With html formatting:
my_data$content

# Now remove it:
my_data$content <- remove_html(my_data$content)

# Without html formatting:
my_data$content

## End(Not run)

[Package postlightmercury version 1.2 Index]