无法找到要导入googlesheet的正确xpath

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

这是我通过检查元素工具获得的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.)
solabc 回答:无法找到要导入googlesheet的正确xpath

尝试:

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

其中B10是您的网址

0

本文链接:https://www.f2er.com/3074824.html

大家都在问