无法在谷歌表格中找到正确的 xpath 导入

unable to find correct xpath to import in googlesheet

我正在尝试使用 importxml 获取数据,但我无法获取数据 我使用的 XPath 没有提供我想要获取的数据。但我可以使用 importhtm 和提及 table 获得相同的数据,但我需要使用 importxml 来获得最佳匹配。

这是我用 inspect element 工具得到的 XPath

/html/body/div[2]/div[1]/div[1]/table/tbody/tr[1]/td[2]/strong

这里是CSS路径

 div.container-fluid div.row-fluid div.span6 table.table.table-bordered tbody tr td strong

这里是 CSS 选择器

div.span6:nth-child(1) > table:nth-child(1) > tbody:nth-child(1) > tr:nth-child(1) > td:nth-child(2) > strong:nth-child(1)

我试过的

=ImportXML("https://siteurl com","//*[@class='span6']/table/tbody/tr[1]/td[2]/strong")

Got Error #N/A  (Error
Imported content is empty.)

尝试:

=SUBSTITUTE(INDEX(IMPORTHTML(B10, "table", 1), 1, 2), "*", )*1

其中 B10 是你的 URL