How toTechnical SEO

How to extract title & meta data using Gdocs, Xpath and ImportXml

By August 13, 2013 No Comments

I’m pretty sure everyone knows I have an unhealthy obsession with Google docs, and the wonderful things it can achieve. Paul from Clixfuel.com asked how to get common meta data from a webpage quickly using ImportXML, so here it is:

1) Get the meta description

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

2) Get the title

//title

3) Get the keywords

//meta[@name='keywords']/@content"

Okay, let’s go ahead and pull out the title, meta description and meta keywords from a webpage:

=importxml("https://www.davidsottimano.com/how-to-extract-title-meta-data-using-gdocs-xpath-and-importxml/","//title")
=importxml("https://www.davidsottimano.com/how-to-extract-title-meta-data-using-gdocs-xpath-and-importxml/","//meta[@name='description']/@content")
=importxml("https://www.davidsottimano.com/how-to-extract-title-meta-data-using-gdocs-xpath-and-importxml/","//meta[@name='keywords']/@content")

Go check out the sheet to see it work!

Hope that helps, enjoy!

Dave

Author Dave

More posts by Dave