Google 纽约时报的表格 importxml

Google Sheets importxml for New York Times

几个月来,我一直陷入这个棘手的问题。

请访问此link了解详情:

[目标]

By importxml, it is to get the data and its a href link in Google Sheets, but I failed in bringing the link in. Let me know how to bring the href link in B2.

[问题]

A href link doesn't have its class.

请访问下面的 link 查看详细信息,因为我是 Whosebug 的新手,没有资格上传图片。对不起。

[下面的代码应该可以工作,但不会产生任何结果] 我认为存在 xpath 语法错误。


A2:http://www.nytimes.com/pages/world/index.html
B2: =importxml(A2, ʺ//div[@class='story']|//div[@class='thumbnail' ]//a/@hrefʺ)

B2 没有显示任何结果。

https://productforums.google.com/forum/#!searchin/docs/importxmlnewyorktimes/docs/4-IJJ6_h5Pw/prNdITEsQ4AJ

您仍然不太清楚您想找到什么,但有时对尝试的解决方案发表评论比尝试解释更容易。

您显示的公式有 return 个结果。如果我在自己的表格文件中添加以下内容:

=IMPORTXML("http://www.nytimes.com/pages/world/index.html", "//div[@class='story']|//div[@class='thumbnail']//a/@href")

函数return有几个href属性,结果看起来像

这是您期望的结果还是您想更改结果?