html_attrs_dfr {polite} | R Documentation |
Convert collection of html nodes into data frame
Description
Convert collection of html nodes into data frame
Usage
html_attrs_dfr(
x,
attrs = NULL,
trim = FALSE,
defaults = NA_character_,
add_text = TRUE
)
Arguments
x |
|
attrs |
character vector of attribute names. If missing, all attributes will be used |
trim |
if |
defaults |
character vector of default values to be passed to |
add_text |
if |
Value
data frame with one row per xml node, consisting of an html_text column with text and additional columns with attributes
Examples
library(polite)
library(rvest)
bow("https://en.wikipedia.org/wiki/List_of_cognitive_biases") %>%
scrape() %>%
html_nodes("tr td:nth-child(1) a") %>%
html_attrs_dfr()
[Package polite version 0.1.3 Index]