tbody table returns empty list

77 views Asked by At

I would like to webscrape a table from a webpage which has a data_table class. The data is within the tbody but when I use the xpath of the table it returns an empty list. Here is some reproducible code:

library(dplyr)
library(rvest)
link <- "https://www.mariokartcentral.com/mkc/registry/players"
page <- read_html(link)

page %>%
  html_nodes(xpath = '//*[@id="players_list"]/table/tbody') %>%
  html_table(fill = TRUE)
#> list()

Created on 2024-02-20 with reprex v2.0.2

Here is the element:

enter image description here

As you can see from the output it returns an empty list. So I was wondering if anyone knows how to web scrape a tbody element like above?

0

There are 0 answers