Scraping table issue with rvest

Hi All,

I am trying to scrape a single table of NASCAR rankings. I had run
this code a long time back, and it had worked, but is no longer working.

nsc_url <- ""
nsc_html <- xml2::read_html(x = nsc_url)

out_tbl <- nsc_html %>%
    rvest::html_nodes("table") %>%
    .[1] %>%
    rvest::html_table(fill = TRUE) %>%
    purrr::pluck(.x = ., 1) %>%
    dplyr::mutate(.data = .,
                  year = nsc_year,
                  race_num = nsc_race) %>%
    dplyr::rename(.data = .,
                  "pls_min_mv" = "+/-",
                  "top_5" = "Top-5",
                  "top_10" = "Top-10")

The nsc_html %>% rvest::html_nodes("table") line won't pickup the large table for some reason, even though it is clearly visible when you right click and "Inspect Element" on the website.

Could anyone please assist with this getting this code to work as intended?


This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.