Когда вы нажимаете на каждую букву на странице, javascript отправляет запрос xhr POST на другой URL-адрес на сервере и кодирует запрос как вложенный JSON. Плохая новость заключается в том, что вам нужно будет сделать то же самое, чтобы очистить данные. Хорошая новость заключается в том, что вы можете получить все данные за один прием, если правильно напишите запрос.
Вам понадобится пакет Rcurl или httr, чтобы обеспечить этот уровень контроля над запросами http.
# We'll use httr and tidyverse
library(tidyverse)
library(httr)
# This is the actual url that sends the JSON data
url <- "https://www.rsaconference.com/api/Search/FilteredSearch"
# These are the parameters we want to post. Note I have left the searchFilterLetter
# field blank so it sends us everything.
params <- list(defaultFilterContentType = "Exhibitor",
searchInput = "",
searchFilterLetter = "",
exhibitorLocation = "none",
exhibitorType = "none",
filterTopicsTypeahead = "",
filterTopics = "",
searchSort = "alpha",
filterRegion = "USA",
filterConferenceYear = "2020")
# A complicating factor is that the above parsmeters are wrapped inside another
# parameter called formDsta, along with two other parameters. Note I want all
# exhibitors so I set resultsPerPage to 1000
body <- list(page = 1, resultsPerPage = 1000, formData = params)
# Now we post the form to the url and read the parsed JSON response.
# I have selected two fields from the resulting list.
POST(url, body = body, encode = "json") %>%
content("parsed") %>%
`[[`("results") %>%
lapply(function(x) data.frame(name = x$title, url = x$url)) %>%
{do.call("rbind", .)} %>%
as_tibble ->
all_exhibitors
А вот и ваши результаты ...
print(all_exhibitors)
#> # A tibble: 635 x 2
#> name url
#> <fct> <fct>
#> 1 1TOUCH.io /usa/expo-and-sponsors/1touchio
#> 2 360 Group /usa/expo-and-sponsors/360-security-group
#> 3 Abnormal Security /usa/expo-and-sponsors/abnormal-security-corporation
#> 4 Acalvio Technologies /usa/expo-and-sponsors/acalvio-technologies
#> 5 Accedian /usa/expo-and-sponsors/accedian-networks
#> 6 achelos GmbH /usa/expo-and-sponsors/achelos-gmbh
#> 7 ACID Technologies /usa/expo-and-sponsors/acid-technologies
#> 8 Active Defense Institute /usa/expo-and-sponsors/active-defense-institute-ltd
#> 9 Acunetix /usa/expo-and-sponsors/acunetix
#> 10 Adaptiva /usa/expo-and-sponsors/adaptiva
#> # ... with 625 more rows