如何在 Steam Workshop 上为 Google Sheets 的 IMPORTXML 获取正确的 XPath?

How to get the correct XPath for Google Sheets' IMPORTXML on the Steam Workshop?

我正在尝试设置 Google 表格文档以从 Steam 创意工坊获取 mod 更新日期和时间。我如何找到 ImportXML XPath 字段的正确值?

我已经尝试复制 XPath 以获得我要获取的特定值,但它似乎不起作用。

=IMPORTXML("https://steamcommunity.com/sharedfiles/filedetails/?id=843425103", //*[@id="mainContents"]/div[11]/div/div[2]/div[4]/div[2]/div[3]])

我希望它的输出是 Sep 16, 2018 @ 5:24pm 相反,它告诉我我有一个公式解析错误。

确实你的语法有误。 XPath 需要用引号引起来,不允许使用双引号,所以:

=IMPORTXML("https://steamcommunity.com/sharedfiles/filedetails/?id=843425103", 
 "//*[@id='mainContents']")

示例:

=IMPORTxML("https://steamcommunity.com/sharedfiles/filedetails/?id=843425103", 
 "//div[@class='detailsStatRight']")