How do I extract the data table from the following page: link
How do I extract the data table from the following page: link
Take a look at the rvest
package.
The page you want was actually built using bad practices, which makes the job a bit difficult. By analyzing the code of the page, you can find out that the content is in fact at link
Then, the following code captures the content of the page:
library(rvest)
tb = read_html("http://www.ons.org.br/resultados_operacao/boletim_semanal/2016_12_16/ena_arquivos/sheet001.htm") %>%
html_node("table") %>%
html_table(fill = TRUE)
Then you use subsetting to get just what matters, and put some proper names in the columns.
tb = tb[6:9, 2:4]
colnames(tb) = c("Região", "M/W Médios", "% MLT")