This is the website I'm trying to scrape from: https://www.premierleague.com/match/38413
I'm trying to get the table that has Match Stats, but when I try to scrape it, I only get the first line, which includes the team names only!
This is the code I'm using:
library(rvest)
url <- "https://www.premierleague.com/match/38413"
my_html <- read_html(url)
tbls_ls <- my_html %>%
html_nodes("table") %>%
.[2] %>%
html_table(fill = TRUE)
I'm no R expert so I'm not really sure what I'm doing wrong, but would love assistance!