Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 201894

Extract table from a JavaScript based webpage

$
0
0

I want to extract the table under the Option Chain tab of the following webpage using R -

https://nseindia.com/get-quotes/derivatives?symbol=SBIN

Webpage snapshot

I am trying to use rvest for this purpose, however the standard way of extracting tables from simple html based webpages don't seem to be working.

The following is what I'm trying -

library('rvest')
x <- c('https://nseindia.com/get-quotes/derivatives?symbol=SBIN')
url <- paste(x,collapse="")
webpage <- read_html(url)
data <- webpage %>% html_nodes(xpath = '//*[@id="optionChainTable-equity"]') %>% html_table()

This is returning an empty list. What am I missing?


Viewing all articles
Browse latest Browse all 201894

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>