0

I am trying to extract the table from this link into R. The table is the stock price for SBIN for the past 24 months. Here is the original site.

I tried using RSelenium and httr package as suggested from here and here but couldn't extract the table.

Nad Pat
  • 3,129
  • 3
  • 10
  • 20

1 Answers1

0

You can get the data with rvest.

library(rvest)
url <- 'https://www1.nseindia.com/products/dynaContent/common/productsSymbolMapping.jsp?symbol=sbin&segmentLink=3&symbolCount=1&series=ALL&dateRange=24month&fromDate=&toDate=&dataType=PRICEVOLUMEDELIVERABLE'

url %>% 
  read_html %>% 
  html_table() %>%
  .[[1]] -> result

result
Ronak Shah
  • 377,200
  • 20
  • 156
  • 213