使用Insertxml搜索工作表。你有没有关于如何摆脱这种“错误”的想法;公式分析错误";?
我试图在谷歌表单上使用insertxml从网站上获取最新的定价。我似乎不明白为什么每次都会出现公式解析错误 这是我试图使用的代码使用Insertxml搜索工作表。你有没有关于如何摆脱这种“错误”的想法;公式分析错误";?,xml,xpath,google-sheets,Xml,Xpath,Google Sheets,我试图在谷歌表单上使用insertxml从网站上获取最新的定价。我似乎不明白为什么每次都会出现公式解析错误 这是我试图使用的代码 =IMPORTXML( “https://www.menards.com/main/lighting-ceiling-fans/ceiling-fans/indoor-ceiling-fans/patriot-lighting-reg-gilford-52-led-ceiling-fan/20200/p-1502778723314-c-7488.htm”,"//div
=IMPORTXML( “https://www.menards.com/main/lighting-ceiling-fans/ceiling-fans/indoor-ceiling-fans/patriot-lighting-reg-gilford-52-led-ceiling-fan/20200/p-1502778723314-c-7488.htm”,"//div[@class='d-inline']//span[@class='d-none',data-at-id='itemFinalPrice']")
我也尝试过去掉class='d-none'
,但没有效果
关于如何启动和运行它,有什么想法吗?对xpath的这种修改怎么样?在您的情况下,
id处的数据
用作属性,就像@data at id
一样。和,
修改为和
发件人:
致:
或
或
结果:
- 在这种情况下,URL被放入单元格“A1”。并且使用了
=IMPORTXML(A1,“//div[@class='d-inline']///span[@class='d-none'和@data at id='itemFinalPrice'])”
的公式
如果我误解了你的问题,并且这不是你想要的方向,我很抱歉。你想通过使用,id='itemFinalPrice']构造的数据暗示什么?它看起来不像一个合法的XPath表达式。
//div[@class='d-inline']//span[@class='d-none',data-at-id='itemFinalPrice']
//div[@class='d-inline']//span[@class='d-none' and @data-at-id='itemFinalPrice']
//span[@class='d-none' and @data-at-id='itemFinalPrice']
//span[@data-at-id='itemFinalPrice']