3

I am trying to extract the data from the webpage https://www.geojit.com/other-market/world-indices and many others similar to this.

I need to get the tabular data of the website (INDEX,NAME,COUNTRY,CLOSE,PREV.CLOSE,NET CHANGE,CHANGE (%),LAST UPDATED DATE & TIME). would be great if you can share the R code for this or any help would be welcome.

library(rvest)
library(dplyr)   
google <- html("https://www.geojit.com/other-market/world-indices")    
google %>%    
html_nodes()
Evan Strom
  • 65
  • 1
  • 7

1 Answers1

2
library(rvest)
my_tbl <- read_html("https://www.geojit.com/other-market/world-indices") %>%    
  html_nodes(xpath = "//*[@id=\"aboutContent\"]/div[2]/table") %>%
  html_table(header = TRUE) %>%
  `[[`(1)
Ramiro Magno
  • 3,085
  • 15
  • 30