xpath in =importXML() for extracting meta descriptions
I'm trying to use Xpath to pull in the meta descriptions from web pages, using Google Sheets.
I have this working to pull in the titles: =importXml(www.example.com; "//title")
Here are two sources of my learning:
http://seogadget.co.uk/playing-around-with-importxml-in-google-spreadsheets/
http://docs.google.com/support/bin/answer.py?hl=en&answer=7550开发者_如何学编程7I have read many other posts on this site, and this seems to be the similar idea of what I want:
"/html/head/meta[@name='description']/@content"
"/*/head/meta[@name='description']/@content"
"//head/meta[@name=\"description\"]/@content"
None of these work in Google Sheets, which specifies to write it in Xpath. The only difference, is that in Google Sheets you are to use ' in place of " (hence why description is like that). I've honestly tried it about 219 different ways....no luck.
Any ideas? Thanks in advance!
//meta[@name='description']/@content
So your full URL call in google sheet would be
=importxml(A1,"//meta[@name='description']/@content")
I've built some awesome SEO tools using importXML - this is just the start of it mate! :)
精彩评论