I’m pretty sure everyone knows I have an unhealthy obsession with Google docs, and the wonderful things it can achieve. I’ve actually switched from my beloved Microsoft suite to Gdocs full time. Just waiting for those clever Google engineers to up the capacity on the 400k rows of data in a spreadsheet.
Okay, so the first thing I’m going to say is to always do a quick Google for any Xpath around your topic, and then understand you’ll need to adapt it for Google docs – you just need to know what you need to change I found a brilliant response here, which I’m actually going to use.
Here, he’s extracting the meta description via PHP like so:
Oooh, cool. Only one teeny, tiny problem – Google docs uses a slightly different syntax for Xpath (don’t ask me why exactly, I’m not a programmer, I’m a hack job). This is right, notice the single quotes around description:
We don’t even need to step backwards to the <html> or <head> tag either! This will work too:
Go ahead, try it. ..
Yeah, I thought you would feel that way – good job!
Okay, let’s go ahead and pull out the title, meta description and meta keywords from a webpage:
Go check out the sheet to see it work!
Hope that helps, leave any questions in the comments and I’ll get back to you.