本文介绍了Google表格IMPORTXML XPath查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试使用Google工作表中的IMPORTXML功能来获取此页面上的时间戳 - 。



我使用过开发者工具在铬中突出显示时间戳并复制xpath。我的公式如下所示:
$ b = importxml(a1,(// * [@ id =cb-featured-image] / div [1] / div / span / time))



但是有公式分析错误。有人可以帮助我用正确的方式教育我吗?



谢谢! 应该由'



/ p>

  = importxml(a1,(// * [@ id ='cb-featured-image'] / div [1] / div / span / time))

注意: IMPORTXML 只能看到源代码,而Google Chrome浏览器显示的页面代码由于JavaScript或浏览器引擎的更改而不能相同,所以 xPath 可以被 IMPORTXML 看到。


I'm trying to use the IMPORTXML function in Google sheets to grab the time stamp on this page - https://www.dealsandreviews.co.uk/best-bookshelf-speakers-ranked.

I have used developer tools in chrome to highlight the time stamp and copy the xpath. My formula looks like this:

=importxml(a1, (//*[@id="cb-featured-image"]/div[1]/div/span/time))

However there is formula parse error. Could someone help educate me with the correct formula?

Thanks!

解决方案

Text values should be enclosed between ". However, An inner " should be replaced by '.

Try

 =importxml(a1, "(//*[@id='cb-featured-image']/div[1]/div/span/time)")

Note: IMPORTXML only sees the source code while Google Chrome shows the code of the displayed page that could not be the same due to JavaScript or by changes made by the browser engine, so the xPath returned by Google Chrome could be seen by IMPORTXML.

这篇关于Google表格IMPORTXML XPath查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-19 02:06