Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
useR2017 attendees
library(rvest)
library(purrr)
library(tibble)
library(dplyr)
library(stringr)
attendees <- function(page) {
extract <- function(class) html_node( persons, class ) %>% html_text() %>% str_trim()
url <- paste0( 'https://user2017.sched.com/directory/attendees/', page )
persons <- read_html(url) %>%
html_nodes(".sched-person")
tibble(
position = extract(".sched-event-details-position"),
company = extract(".sched-event-details-company"),
id = extract("h2:nth-child(2) a"),
img = html_node(persons, "img") %>% html_attr("src")
)
}
data <- map_df( 1:6, attendees )
data %>%
summarise( profile = sum(!is.na(img)) / n() )
@romainfrancois

This comment has been minimized.

Copy link
Owner Author

romainfrancois commented Jul 6, 2017

> data %>% summarise( profile = sum(!is.na(img)) / n() )
# A tibble: 1 x 1
    profile
      <dbl>
1 0.4186779
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.