首页 > 解决方案 > 带有搜索和 JSON 数据的 IMPORTXML?

问题描述

我在网站上有此代码

<div id="productPriceJSON_18678511"  style="display:none;">
        [{
            "isXPromoProd":"true",
            "mfPartNumber":"961576-BLACK",
            "productGroupId":"18678008",                
            "productId" : "18678511",
            "listPrice" :"$85.00",
            "offerPrice" :"$85.00",
            "discountPrice" :"$42.50",
            "lowestPriceAmount" :"$42.50",
            "highestPriceAmount" :"$42.50",
            "colorCount" : "0",
            "isPriceVary" :"false"
            }]
    </div>

有不同的 DIV,具有不同的 SKU 变量 productPriceJSON_18678522、productPriceJSON_18678533、productPriceJSON_18678544 等。

我想做两件事:

  1. 导入所有包含 productPriceJSON_ 的 DIV,我尝试使用

    //div[@id=[包含(.,"skuPriceJSON_")]]

但没有运气

  1. 我怎样才能从这个 DIV 匹配 $42.50 中获得折扣价?

非常感谢这里的帮助。

干杯,B.

标签: google-apps-scriptgoogle-sheetsgoogle-sheets-formula

解决方案


推荐阅读