get_html_element: Find html element(s) using a remote client driver

View source: R/get_html_elements.R

get_html_elementR Documentation

Find html element(s) using a remote client driver

Description

Find html element(s) using a remote client driver

Usage

get_html_element(remDr, ..., type = "text", attribute_selector)

get_html_elements(remDr, ..., type = "text", attribute_selector)

Arguments

remDr

Remote client driver

...

Additional arguments passed on to rvest::html_elements. Usually, a css or xpath.

type

Choose 'text', 'attribute', 'attributes' or 'table' as they relate to the rvest:html_* functions.

attribute_selector

Name of attribute to find, using rvest::html_attr

Value

html element(s)

Examples

## Not run: 
# Initiate server
remDr <- RSelenium::rsDriver(port = netstat::free_port(),
browser = "firefox", verbose = FALSE)$client

# Navigate to website & get html element
remDr$navigate("https://duckduckgo.com")
get_html_element(remDr = remDr, css = ".content-info__title", type = "text")

# Close the server
remDr$close()
gc(remDr)
rm(remDr)

## End(Not run)

moamiristat/grocerycart documentation built on June 15, 2022, 10 a.m.