0
votes

The following function in Google Sheets worked until last Friday:

=index(IMPORTHTML("https://finance.yahoo.com/quote/"&B1&"/key-statistics?p="&B1&"","table", 2),5,2)

This function would go to the statistics section in Yahoo Finance and extract the Market Cap from a stock. It stopped working today and I'm not sure why.

I tried using the following command in the Chrome console to get the table number and played with the table indices for the IMPORTHTML function but no luck:

var i = 1; [].forEach.call(document.getElementsByTagName("table"),
function(x) { console.log(i++, x); });

Did Yahoo do something to make this no longer work? OR are my indices just wrong now?

1
Can I ask you about the sample URL and the result values you want? Unfortunately, I cannot understand about the value of "B1". I apologize for this.Tanaike
Hi Tanaike: The value B1 is the cell in google sheets that represents the user inputted ticker (e.g. AAPL = Apple)waltz777
Thank you for replying. From your replying, the value of "B1" is AAPL = Apple. Is my understanding correct? And, can I ask you about the result values you want? Unfortunately, I cannot understand about it from your replying. I apologize for this.Tanaike

1 Answers

0
votes

I tried using every IMPORT formula of Google Sheets and unfortunately, it is returning the same error every single time.

enter image description here

It seems that Yahoo changed some things in their website and it resulted to the import formula not to work anymore.

I suggest finding another website/data source that will give you the same information that you need. Or if you want to stay with Yahoo Finance, you can explore and try to use their API if you want (link-here).

EDIT: Upon further checking, it seems that this issue is only happening on some of the tickers and some webpage in Yahoo Finance. Another option would be waiting for Yahoo to fix the issue.