remove_html: Removes html

Description Usage Arguments Value Examples

View source: R/mercury.R

Description

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

Usage

1
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
## 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)

postlightmercury documentation built on May 2, 2019, 2:08 a.m.