【问题标题】:importxml google docs - import internal errorimportxml google docs - 导入内部错误
【发布时间】:2015-08-13 14:56:36
【问题描述】:

我正在努力关注英超梦幻足球网站上的比赛周得分。

我试图从中导入 xml 的网页是 http://fantasy.premierleague.com/entry/79000/event-history/1/

XPATH(在 Chrome 中使用 XPATH HELPER 扩展获取)是

html[@class='js flexbox canvas canvastext webgl no-touch geolocation postmessage websqldatabase indexeddb hashchange history draganddrop websockets rgba hsla multiplebgs backgroundsize borderimage borderradius boxshadow textshadow opacity cssanimations csscolumns cssgradients cssreflections csstransforms csstransforms3d csstransitions fontface generatedcontent video audio locals inlinesvg smil svgclippaths']/body/div[@id='body']/div[@class='ismWrapper']/div[@class='ismContent clearfix']/div[@id='ism']/section [@class='ismSecondary']/div[@class='ismMod'][1]/div[@class='ismModBody']/dl[@class='ismDefList ismRHSDefList']/dd[1]

结果应该是 38。我从下面得到一个“导入内部错误”

=IMPORTXML("http://fantasy.premierleague.com/entry/79000/event-history/1/", "//html[@class='js flexbox canvas canvastext webgl no-touch geolocation postmessage websqldatabase indexeddb hashchange history draganddrop websockets rgba hsla multiplebgs backgroundsize borderimage borderradius boxshadow textshadow opacity cssanimations csscolumns cssgradients cssreflections csstransforms csstransforms3d csstransitions fontface generatedcontent video audio localstorage sessionstorage webworkers applicationcache svg inlinesvg smil svgclippaths']/body/div[@id='body']/div[@class='ismWrapper']/div[@class='ismContent clearfix'] /div[@id='ism']/section[@class='ismSecondary']/div[@class='ismMod'][1]/div[@class='ismModBody']/dl[@class=' ismDefList ismRHSDefList']/dd[1]]")

有什么想法吗?

【问题讨论】:

    标签: xml xpath import google-sheets


    【解决方案1】:

    您的 xpath 太复杂了 - 有了这些,尤其是在 google 文档中,实际上最好是稍微不那么复杂和更模糊,但是从通配符开始,然后指定最接近的唯一类,然后在需要时缩小范围.

    试试这个:

    =IMPORTXML("http://fantasy.premierleague.com/entry/79000/event-history/1/","//*[@class='ismModBody']/*/dd[1]")
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-05-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多