2012-10-09 86 views
1

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

使用Firefox我发现了2个插件,显示了xpath代码(“firebug”和“xpath checker”)。 使用Firebug我有这样的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") 

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

回答

2

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

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

必须工作。

否则 - 检查语法(” VS“)否则 - 试试,看看更广阔的哪里的问题是(谷歌电子表格有时有怪异的行为),例如:

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