Reputation: 163
I am trying to extract all the player links from this table:
https://www.footballdb.com/players/players.html?letter=A
Here is what my code looks like:
library(rvest)
url <- "https://www.footballdb.com/players/players.html?letter=A"
webpage <- read_html(url)
webpage %>%
html_nodes("table") %>%
html_attr("href")
This returns an NA. I've seen other posts with similar questions, but I have been unsuccessful in understanding the answers well enough to apply them to this problem. Any solutions and/or guidance would be much appreciated. Thanks.
Upvotes: 2
Views: 564
Reputation: 9809
I think you have to scrape a bit deeper ;)
webpage %>%
html_nodes("table") %>%
html_nodes("td") %>%
html_nodes("a") %>%
html_attr("href")
Upvotes: 5