首页 > 解决方案 > Google 表格 ImportHTML 找不到表格?

问题描述

我以前使用过 ImportHTML 很多次,从来没有遇到过任何问题,但由于某种原因,我似乎无法从 Basketball-Reference 中拉出特定的表,即使我已经从那里拉出了其他表就好了. 我想要的表格是本页下方的 Miscellaneous Stats 表格。我已经尝试了函数中从 1 到 30 的每个索引,但是超过 7 的索引都没有带来任何数据。我正在使用的函数如下,将 1 更改为我正在尝试的任何索引:

=IMPORTHTML("https://www.basketball-reference.com/leagues/NBA_2019.html", "table", 1)

我尝试在 Chrome 的控制台中使用以下代码来查找页面的索引,但它没有返回任何内容:

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

有谁知道我怎样才能让这个表与 ImportHTML 一起工作?

标签: google-sheets

解决方案


Well, player0 was correct about being unable to scrape the JS table, but luckily I was able to use the URL for the embed version of that table, which works perfectly with ImportHTML.


推荐阅读