1 year ago

#313386

test-img

doglover123

How do I use importXML/importHTML to retrieve a stock options chain that is hidden?

I am trying to use importXML or importHTML function to retrieve a stock options chain, specifically using this function to get a table. So far, this is what I have:

=importhtml("https://bigcharts.marketwatch.com/quickchart/options.asp?symb=TSLA","table",3)

The problem I'm getting is that I can't retrieve "hidden" tables. For example, if you go on the website: https://bigcharts.marketwatch.com/quickchart/options.asp?symb=TSLA

If you scroll down on this page the hidden tables would only be revealed if you click on ,"show april 2022", "show may 2022", etc. I am trying to retrieve all of this information.

The end result is that I would like to create a table that looks like this: https://www.barchart.com/stocks/quotes/tsla/put-call-ratios

And a table that looks like this: https://www.barchart.com/stocks/quotes/TSLA/options?moneyness=10&view=stacked&expiration=2022-04-14-m

As a result, there are two things that I am trying to create, the above tables shown on barchart.

I have tried to use importHTML or importXML on barchart, but it looks like it's not allowed. If there is a way to directly retrieve the information from barchart, that would be a much better solution rather than having to import all of the data separately using a different website.

Please note, that I do have a beginner knowledge, so a step-by-step solution on what to do would be very helpful. Thank you

google-sheets

google-sheets-formula

google-sheets-api

stockquotes

0 Answers

Your Answer

Accepted video resources