【发布时间】:2021-06-11 09:58:01
【问题描述】:
我一直无法为 Google 表格 ImportXML 找到正确或准确的 Xpath。
相关文章: https://www.digitaltrends.com/news/this-is-what-a-birthday-party-on-the-iss-looks-like/
我正在寻找的结果:
'post_name': 'this-is-what-a-birthday-party-on-the-iss-looks-like'
使用 Chrome Inspect 功能中的“复制完整 XPath 功能,我得到:
/html/head/script[43]/text()
这不适用于 Google 表格的 ImportXML 功能。有人可以指导我如何提取网站的这一部分吗?
编辑:我正在尝试检索这些参数中的任何内容,例如“帖子名称、帖子标题、帖子 ID”。 [查看源代码1
【问题讨论】:
-
这对您解释您实际想要实现的目标会有所帮助。内容“this-is-what-a-birthday-party-on-the-iss-looks-like”可在此页面的多个位置找到,其中一些可以很好地与 IMPORTXML 函数配合使用。与从脚本内容中挖掘它相比,可能有更简单的选择。
-
请edit您的问题并将您的代码添加为minimal reproducible example和输入html。不要链接到页面,该页面可能会改变,使问题成为有争议的问题。另见How to Ask。
标签: xpath google-sheets-formula