wc_html_text: Extract attributes, text and tag name from webclient page...

Description Usage Arguments Examples

View source: R/wc-html-nodes.R

Description

Extract attributes, text and tag name from webclient page html content

Usage

1
2
3
4
5
wc_html_text(dom_node, trim = FALSE)

wc_html_attr(dom_node, attr)

wc_html_name(dom_node)

Arguments

dom_node

a webclient page DOM node (likely produced by wc_html_nodes())

trim

if TRUE will trim leading/trailing white space

attr

name of attribute to retrieve

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
## Not run: 
wc <- web_client()

wc %>% wc_go("https://usa.gov/")

wc %>%
  wc_html_nodes("a") %>%
  sapply(wc_html_text)

wc %>%
  wc_html_nodes(xpath=".//a") %>%
  sapply(wc_html_text)

wc %>%
  wc_html_nodes(xpath=".//a") %>%
  sapply(wc_html_attr, "href")

## End(Not run)

hrbrmstr/htmlunit documentation built on Aug. 19, 2020, 3:05 p.m.