Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/google-sheets/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Xpath Google表单导入XML查询_Xpath_Google Sheets_Google Sheets Formula_Google Sheets Importxml - Fatal编程技术网

Xpath Google表单导入XML查询

Xpath Google表单导入XML查询,xpath,google-sheets,google-sheets-formula,google-sheets-importxml,Xpath,Google Sheets,Google Sheets Formula,Google Sheets Importxml,我使用谷歌表单作为网络刮刀 我一直在使用这个IMPORTXML =importxml(A1,“//div[@class='review-content']///text()” 这就是结果 Row1: {"publishedDate":"2019-01-05T22:19:28Z","updatedDate":"null","reportedDate":"null} Row2: {"publishedDate":"2018-12-10T22:19:28Z","updatedDate":"null"

我使用谷歌表单作为网络刮刀

我一直在使用这个IMPORTXML

=importxml(A1,“//div[@class='review-content']///text()”

这就是结果

Row1: {"publishedDate":"2019-01-05T22:19:28Z","updatedDate":"null","reportedDate":"null}

Row2: {"publishedDate":"2018-12-10T22:19:28Z","updatedDate":"null","reportedDate":"null}

Row3: {"publishedDate":"2018-12-09T22:19:28Z","updatedDate":"null","reportedDate":"null}
但是我很难弄清楚如何只获取“publishedDate”值。 例如:


关于我可能遗漏的内容,你有什么想法吗这3个样本怎么样?我是从你的问题样本中想到的。我认为对你的情况有几个答案。因此,请将其视为其中的3个样本

它假定URL放在单元格“A1”中

样本1:
  • 当每个值的字符串长度为常量时,这个值如何?
    • 该值由
      MID()
      检索
样本2:
  • 当每个值的位置都是常数时,这个值怎么样?
    • 该值由
      SPLIT()
      INDEX()
      检索
样本3:
  • 当每个值的模式都是常量时,这个呢?
    • 该值由
      REGEXEXTRACT()
      检索
参考资料:

如果这些不是你想要的结果,我道歉。此时,为了正确地复制您的情况,您可以提供您正在使用的URL吗?

您正在导入的XML的URL是什么?您提供的所有示例都可以正常工作。非常感谢您的帮助。@mauro Bros欢迎您。谢谢你让我知道。如果您的问题已解决,请按“接受”按钮。与您有相同问题的其他人也可以将您的问题作为可以解决的问题。如果你找不到按钮,尽管告诉我@毛罗兄弟感谢您的回复。
Row1: 2019-01-05T22:19:28Z

Row2: 2018-12-10T22:19:28Z

Row3: 2018-12-09T22:19:28Z
=ARRAYFORMULA(MID(IMPORTXML(A1, "//div[@class='review-content']//text()"),19,20))
=ARRAYFORMULA(INDEX(SPLIT(IMPORTXML(A1, "//div[@class='review-content']//text()"),"""",TRUE,TRUE),,4))
=ARRAYFORMULA(REGEXEXTRACT(IMPORTXML(A1, "//div[@class='review-content']//text()"),"publishedDate"":""(\w.+?)"""))