google-sheets - 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 一起工作?
解决方案
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.
推荐阅读
- flutter - Flutter 有除了 material 和 cupertino 之外的小部件吗?
- javascript - 在 foreach 循环中单击一个面板时折叠其他面板
- ruby - 理解 Ruby 中的“.with”
- php - 在 WooCommerce 的地址字段中需要文本和数字
- server - 设置传送 - 使用 Let's Encrypt 配置域名并获取 TLS 证书
- ios - 如何将 Swift 代码(类)与 Objective-C 结合起来?
- database - Clickhouse数据库中的物化视图不显示数据
- java - 如何使用带有日历对象的 AM PM 设置正确的时间?
- node.js - MongoDB搜索多个集合
- c++ - 左移一个数字