xml - 谷歌表格 ImportXml() 从表中提取数据
问题描述
我正在尝试使用 IMPORTXML 函数从 URL 检索单个单元格数据,但不知道如何扩展查询。以下查询检索所有行。
=IMPORTXML("https://www.bullion-rates.com/gold.htm", "//td[@class='rate']")
1,276.84 ChartsHistory
1,146.68 ChartsHistory
1,011.26 ChartsHistory
82,979 ChartsHistory
但我只需要第 4 行和第 1 列 (82,979) 中的数据。如何使用 importxml 进行查询。
解决方案
这个之前已经回答过了。尝试:
=index(IMPORTXML("https://www.bullion-rates.com/gold.htm", "//td[@class='rate']"),4,1)
推荐阅读
- java - sqljdbc4.jar - 无法连接到 MSSQL 服务器实例 - SSL 错误?
- android - 构建警告:将新 ns 映射到旧 ns
- c# - 如何使许多富文本框的动态字体更小
- javascript - 如何在Jquery中将文本附加到左侧而不是添加到右侧
- sql - 如何选择一组预定义的值及其计数?
- alteryx - 如何将 Alteryx .yxzp 文件解包到较低版本
- wpf - 如何使用 MVVM 模型从 WPF 中的 CheckListBox 中绑定选中/选定项目(我正在使用“WPFToolkit.Extended.dll”来获取 CheckListBox 控件)
- c# - 如何在 C# 的同一个构造函数中初始化同一个类
- terraform - 使用 terraform 在 for_each 嵌套资源中循环
- php - 使用 WordPress 插件中的目录在 URL 上生成自定义输出