Last active
February 22, 2025 19:04
-
-
Save danielvartan/020140db3674f1595970e4b533542dda to your computer and use it in GitHub Desktop.
Parse HTML tables using `rvest`
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# library(clipr) | |
# library(prettycheck) # github.com/danielvartan/prettycheck | |
# library(rvest) | |
parse_html_table <- function(x = clipr::read_clip()) { | |
prettycheck:::assert_character(x) | |
x |> | |
paste0(collapse = " ") |> | |
rvest::read_html() |> | |
rvest::html_element("table") |> | |
rvest::html_table() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment