Google电子表格ImportXML错误:“XPath查询未返回任何数据” [英] Google spreadsheet ImportXML Error:"the XPath query did not return any data"

查看:149
本文介绍了Google电子表格ImportXML错误:“XPath查询未返回任何数据”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试运行此XPath查询时,我仍然遇到此错误。

  // div [@ iti ='0 '] 

在此链接上(从谷歌航班搜索)

  https://www.google.com/flights/#search;f=LGW;t=JFK;d=2014-05-22;r=2014-05 -26 

我得到这样的结果:

  = IMPORTXML(https://www.google.fr/flights/#search;f=jfk;t=lgw;d=2014-02-22;r=2014- 02-26;// div [@ iti ='0'])

我验证了XPath是正确的(我使用XPath帮助程序得到了答案,所需答案是相对于所选第一个航班的数据)。



我猜这是一个问题的语法,但我试着或多或少的所有组合的小写/大写,标点符号(替换;,'),我试图链接存储在单元格中的URI和XPath查询,但没有任何作品。 b
$ b

任何帮助将不胜感激。

决方案

作为事实上,也许它是在新的谷歌表中的错误或他们已经改变了功能是如何工作的。我已经激活了我的,当我尝试使用ImportXML时,它不会工作。由于我在这里有旧的床单(旧机制),他们仍然正常工作。如果我将脚本从旧脚本复制并粘贴到新脚本中,它就不会获得任何数据。



这里是一个例子:

  = ImportXML(http://www.nytimes.com/pages/todayspaper/index.html;// div [@ class ='columnGroup first '] // h3)

如果我在旧机制上运行它,我在新机制上运行同样的方法,首先它会交换我的;对于一个,,然后它会带来一个#N / A警告错误:导入的XML内容不能被解析。



编辑(05/05/2015):
我很高兴地说,我今天再次在新的电子表格中测试了这个函数,并且他们已经修复了它。我每两个月检查一次,现在终于解决了这个问题。我上面添加的示例现在返回信息。


I continue to get this error when I try to run this XPath query

//div[@iti='0']

on this link (flight search from google)

https://www.google.com/flights/#search;f=LGW;t=JFK;d=2014-05-22;r=2014-05-26

I get something like this:

=ImportXML("https://www.google.fr/flights/#search;f=jfk;t=lgw;d=2014-02-22;r=2014-02-26";"//div[@iti='0']")

I verified and the XPath is correct (I get the answer wanted using XPath helper, the answer wanted are the data relative to the first flight selected).

I guess that it is a problem of syntax, but I tried more or less all the combinations of lower/uppercase, punctuation (replacing ; , ' ") and I tried to link the URI and the XPath query stored in cells, but nothing works.

Any help will be appreciated.

解决方案

As a matter of fact, maybe it is a bug on the new google sheets or they have changed how the function works. I've activated mine and when I try to use the ImportXML it simply wont work. Since I have some old sheets here (on the old mechanism) they still work normally. If I copy and paste the script from the old to the new one it simply doesn't get any data.

Here a example:

=ImportXML("http://www.nytimes.com/pages/todayspaper/index.html";"//div[@class='columnGroup first']//h3")

If I run this on the old mechanism it works fine, but if I run the same on the new mechanism, first it will exchange my ";" for a "," and then it will bring a "#N/A" with a warning of "Error: Imported XML content cannot be parsed".

Edit (05/05/2015): I am happy to say that I tested this function again today on the new spreadsheets and they've fixed it. I was checking that every two months and now finally they have solved this issue. The example I've added above is now returning information.

这篇关于Google电子表格ImportXML错误:“XPath查询未返回任何数据”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆