2011-05-19 167 views
2

我正在嘗試使用Xpath從網頁中使用Google表格提取元描述。xpath&Google Sheets = importxml

我有這個工作在片頭拉:=importXml(www.example.com; "//title")

這裏是我學習的兩個來源:

http://seogadget.co.uk/playing-around-with-importxml-in-google-spreadsheets/
http://docs.google.com/support/bin/answer.py?hl=en&answer=75507

我已經在這個網站看了很多其他職位,並這似乎是我想要的類似想法:

"/html/head/meta[@name='description']/@content" 
"/*/head/meta[@name='description']/@content" 
"//head/meta[@name=\"description\"]/@content" 

這些都不能在Google表格中使用,它指定將其寫入Xpath。唯一的區別是,在Google表格中,您將使用「代替」(因此爲什麼描述是這樣的)。我誠實地嘗試了大約219種不同的方式......沒有運氣。

任何想法?!在此先感謝

回答

3
//meta[@name='description']/@content 

因此,在谷歌文檔的完整URL調用將

=importxml(A1,"//meta[@name='description']/@content") 

我使用IMPORTXML內置了一些真棒SEO工具 - 這是它交配僅僅是開始! )

+0

太棒了,很棒!I agre e,importXML for和SEOer可以做一些驚人的事情!謝謝你的幫助。 – Dan 2011-05-25 14:31:16