Scraping .aspx webpage

I'm trying to scrape the main data table from this page https://www.peelschools.org/covid19-advisory/Pages/default.aspx using rvest. Using the selectorgadget the html node for the table header is th however when I run the code I get {xml_nodeset (0)}. What am I missing here?

peelDSB <- "https://www.peelschools.org/covid19-advisory/Pages/default.aspx"

peelDSB %>% 
  read_html() %>% 
  html_nodes("th") %>%
  html_text()

Hi,

If you right-click the webpage and view source, you will see that this table in fact is not embedded in the HTML but dynamically loaded in (likely because of aspx). This mean that conventional scraping with just getting the HTML will not work.

You might want to look into RSelenium, where you can scrape more complex webpages by automating a webbrowser. I don't know the exact implementation for your question here, but I'm sure Google (or someone here) can be helpful.

PJ

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.