Skip to content

Instantly share code, notes, and snippets.

@skvrnami
Created March 6, 2023 18:22
Show Gist options
  • Save skvrnami/d82e0901a09cb86774c02c22ba3d2c77 to your computer and use it in GitHub Desktop.
Save skvrnami/d82e0901a09cb86774c02c22ba3d2c77 to your computer and use it in GitHub Desktop.
library(dplyr)
library(rvest)
html <- read_xml("https://rejstriky.msmt.cz/opendata/vrejcelk.xml", as_html = TRUE)
subjekty <- html %>%
html_nodes("pravnisubjekt")
parse_skola <- function(subjekt){
tibble(
nazev = subjekt %>%
html_node("redplnynazev") %>%
html_text(),
zrizovatel_ico = subjekt %>%
html_node("zrizico") %>%
html_text()
)
}
parse_skola(subjekty[[1]])
purrr::map_dfr(subjekty, parse_skola)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment