0

I can't import the second table of this site on my google sheets: https://www.wsj.com/market-data/quotes/AMZN/financials/annual/balance-sheet

(the table that show when you click on "Liabilities & Shareholders' Equity").

This is my code:

=IMPORTHTML("https://www.wsj.com/market-data/quotes/AMZN/financials/annual/balance-sheet", "table",2)
Rubén
  • 34,714
  • 9
  • 70
  • 166
Damiano Dotto
  • 105
  • 1
  • 10

1 Answers1

1

The table you want is not the 2nd table on the page, it is the 59th table.

Check out the documentation for the IMPORTHTML function here: https://support.google.com/docs/answer/3093339?hl=en

The last argument is which table on the page you want. When I inspected the HTML for the page, I found 115 <table> elements making up the HTML on the page.

So, your code should look like this:

=IMPORTHTML("https://www.wsj.com/market-data/quotes/AMZN/financials/annual/balance-sheet", "table",59)

I just tested this in Google Sheets, and it did import the data.

coltoneakins
  • 849
  • 6
  • 14