【问题标题】:Google spreadsheet ImportXML谷歌电子表格 ImportXML
【发布时间】:2021-06-24 09:58:56
【问题描述】:

我正在尝试将此网站的最低产品价格输入到 Google 电子表格中。 https://multimedialne-centra.heureka.sk/homatics-dongle-q/

我不知道如何输入条件,但它应该是这样的: 从带有参数data-gtm-position-type="free" 的第一个<a> 中获取来自SPANclass="c-offer-v3__price" 的值

但是如何在电子表格中定义呢?

【问题讨论】:

    标签: google-sheets google-sheets-formula spreadsheet


    【解决方案1】:

    您可以为此使用 importxml。如果只是最低价格就可以了。那么你可以写:

    =min(importxml("https://multimedialne-centra.heureka.sk/homatics-dongle-q/";"//span[@class="c-offer-v3__price u-bold u-delta"]"))
    

    它从相应的 xpath 中获取所有值并提取其中的最低值。

    【讨论】:

    • 我会使用 SORT + INDEX 而不是 MIN 因为它需要数值,例如=INDEX(SORT(IMPORTXML("https://multimedialne-centra.heureka.sk/homatics-dongle-q/","//span[@class='c-offer-v3__price u-bold u-delta']")), 1, 1)
    猜你喜欢
    • 1970-01-01
    • 2016-01-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多