I would like to scrape multiple tables from this webpage (https://en.wikipedia.org/wiki/UEFA_Euro_2020_squads). The table that I needed is from [1] - Italy to [23] - Portugal where it contains the player's list for each team participating in Euro 2020.
Below are my codes.
library(rvest)
library(tidyverse)
library(dplyr)
wiki_euro20_link <- "https://en.wikipedia.org/wiki/UEFA_Euro_2020_squads"
wiki_euro20_page <- read_html(wiki_euro20_link)
eur_20 <- wiki_euro20_page %>%
html_nodes("table") %>%
html_table() %>%
.[c(1:24)]
purrr::map(eur_20[-1], dplyr::bind_rows)
The question is:
- How do I combine all the tables in one dataframe?