google-apps-script - 带有搜索和 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 等。
我想做两件事:
导入所有包含 productPriceJSON_ 的 DIV,我尝试使用
//div[@id=[包含(.,"skuPriceJSON_")]]
但没有运气
- 我怎样才能从这个 DIV 匹配 $42.50 中获得折扣价?
非常感谢这里的帮助。
干杯,B.
解决方案
推荐阅读
- angular - 无法从 Angular 应用页面按 id 删除 Firestore 文档
- ios - url中的随机数生成器
- blazor - Blazor:在子组件中登录成功后关闭 MatBlazor 弹出对话框
- r - 排除小数点后的 0
- c++ - 静态数据成员模板特化的实例化点在哪里
- solr - Solr 7 升级 - /update 请求仅发送到 3 个节点中的 1 个
- memory - 检查redis服务器中所有键的大小(以字节为单位)
- scala - spark-submit 中的 java.lang.NoSuchMethodError
- amazon-web-services - 有谁知道如何使用 AWS App2Container(A2C)?
- regex - REGEX - 抑制 Spark SQL 中的不可打印字符