View source: R/get_html_elements.R
get_html_element | R Documentation |
Find html element(s) using a remote client driver
get_html_element(remDr, ..., type = "text", attribute_selector) get_html_elements(remDr, ..., type = "text", attribute_selector)
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 |
html element(s)
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.