【问题标题】:function importxml google spreadsheet函数 importxml 谷歌电子表格
【发布时间】:2012-10-09 09:51:01
【问题描述】:

我必须学习 xpath,我尝试在谷歌电子表格中使用 importxml 函数,但它不起作用。

使用 firefox,我发现了 2 个显示 xpath 代码的插件(“firebug”和“xpath checker”)。 有了萤火虫,我有这个 xpath:

 /html/body/div/div/div[3]/div[3]/div/div/form/h1

并使用 xpath 检查器此代码:

id('titolo1')/h1

我尝试使用此代码:

=importXML("url";"//*[@id='titolo1']/h1")
=importXML("url";"//html/body/div/div/div[3]/div[3]/div/div/form/h1")
=importXML("url";"id('titolo1')/h1")

但它不起作用,任何人都可以看到问题可能出在哪里?

【问题讨论】:

    标签: xml xpath google-sheets


    【解决方案1】:

    在一般情况下显示 H1 的 HTML:

    //*[@id='titolo1']/h1
    

    必须工作。

    Else - 检查句法(' vs ")。Else - 尝试更广泛地查看问题所在(谷歌电子表格有时会出现奇怪的行为),例如:

    //*[@id='titolo1']
    //form
    ...etc.
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-01-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多