Skip to content

Instantly share code, notes, and snippets.

@dwillis
Last active October 11, 2021 17:51
Show Gist options
  • Save dwillis/1b83689b7756c3c93318fd978600792b to your computer and use it in GitHub Desktop.
Save dwillis/1b83689b7756c3c93318fd978600792b to your computer and use it in GitHub Desktop.
html <- read_html("https://merrill.umd.edu/about/faculty-and-staff")
# get faculty/staff names
names <- html %>% html_nodes(".card-title") %>% html_text()
length(faculty_staff)
faculty_staff[1]
# get titles
titles <- html %>% html_nodes(".profile-card-title") %>% html_text()
# create a new dataframe with both
combined <- data.frame(name = names, title = titles)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment