I'm trying to scrape the first table from this url:
using the following code:
url <- "https://www.whoscored.com/Matches/318578/LiveStatistics/England-Premier-League-2009-2010-Blackburn-Arsenal"
data <- url %>%
read_html() %>%
html_nodes(xpath='//*[@id="top-player-stats-summary-grid"]')
which gives data a value of {xml_nodeset (0)}
url <- "https://www.whoscored.com/Matches/318578/LiveStatistics/England-Premier-League-2009-2010-Blackburn-Arsenal"
data <- url %>%
read_html() %>%
html_nodes(css='.grid')
gives the same problem.
Apparently this might be a javascript issue - is there a fast way to extract the relevant data? Inspecting the table entries seems to show that the data is not imported from elsewhere but is coded into the page, so it seems I should be able to extract it from the source code (sorry, I am completely ignorant of how HTML and JS work so my question might not make sense).