【问题标题】:XPATH for Importxml on google-sheets谷歌表格上 Importxml 的 XPATH
【发布时间】:2020-04-25 13:27:15
【问题描述】:

我正在尝试使用 importxml 公式从下面的网页中提取一些数据到 google-sheets。

http://tsetmc.com/Loader.aspx?ParTree=151311&i=25244329144808274

必填字段如附图所示。 required record

请帮助我正确的语法。谢谢。

【问题讨论】:

  • 你需要的是使用javascript动态加载的,所以IMPORTXML不会得到它,因为它不渲染js。您可能想看看这是如何在 Python 中实现的(仅作为示例):stackoverflow.com/questions/8049520/…。然后尝试在 Google Script 中为您的 Sheet 执行相同的操作。

标签: xpath google-sheets-formula


【解决方案1】:

实际上,我们可以从其他地方获取数据。只需使用:

=IMPORTXML("http://en.tsetmc.com/loader.aspx?ParTree=121C1412&inscode=25244329144808274";"//tr[./th[.='Quantity']]/following-sibling::tr[1]/td[2]")

输出:

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-05-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多