Sheets ImportXML Tutorial
Sheets ImportXML Tutorial
Use
ImportXML
in Google
Docs
Written by: Richard Baxter
Put me in front of a Mac and its almost as if I
never learned to use a computer. Put me in
front of Google Spreadsheets and all of the
time Ive spent working with Excel feels a
little like time wasted, and not in a good way.
Im just not very used to a spreadsheet that
isnt Excel.
Unafraid of a challenge, I recently decided to
give Googles (exceptional) importXML,
importFEED and importHTML functions a
try the ability to fetch information from the
web to retrieve the data you need. Mostly to
make an interesting blog post, but partly out
2016 Builtvisible
About
Contacttrying
Services
Work
Its frustrating
to get XML
data Blog
into
Microsoft Excel unless youve got the time
25
and patience to build some basic Macros or
VBscript for your requirements. With Google
Docs, its really easy.
A few resources
If you want to use Google Docs to extract
data from the web, it would be a good idea
for you to learn a little xPath. XPath is used
to navigate through elements and attributes in
an XML document, or, in simple terms, you
can use xPath to fetch little bits of data
contained in structured elements like <span>,
<div> or links or pretty much anything,
really.
Also, there are a few people who have been
doing this a while, and probably have sample
spreadsheets that blow some of the examples
below away but you have to start
somewhere, right? If youre already an
importXML / Google Docs Ninja, maybe go
and find something else to do instead of
reading this post.
If youre interested, I made a Google Docs
Spreadsheet with all of the examples below:
http://bit.ly/9Fs7aF
Software
10
20
bu i l t v i s i b le
/search.atom?q=+restaurant+%22anyone+know%22+london+OR+manchester
Twitter followers
A nod to Steven Foskett for this one, and
particular kudos for the mention of vCard, the
query for LinkedIn connections, Klout score
and Alexa Rank. Nice!
Try this
query: =importXML(http://twitter.com
/[your-username],
//span[@id=follower_count])
Which will give you the number of followers
you have on your Twitter profile. I added
together the total followers that my SEO team
bu i l t v i s i b le
bu i l t v i s i b le
Try something like this:
=ImportXML(http://www.yourcompetitordomain.com
/sitemap.xml,//url/loc)
I mentioned doing this with Excel to find
orphaned pages, but you can have a lot more
fun with importXML. For one, theoretically
you could go off and fetch all keywords
contained in the <title> tag of each of the
URLs an instant keyword strategy!
bu i l t v i s i b le
More Blekko link data
tables
Blekko have a feature that allows for a pretty
insightful breakdown of their SEO data on
your domain. If you want to pull some of that
through in to Google Docs, no problem:
Have fun
This wasnt a particularly advanced post I
did quite enjoy the thought of what to do next
with this data, though. Fetch IP addresses,
WHOIS details, root domain links or
keyword research data with Google Suggest,
the Alchemy API, or plain scraping your
competitor home pages. If youre using
importXML, Id really like to hear how.
Anyway, as I mentioned earlier, please feel
bu i l t v i s i b le
what you did.
A little
update
I got in touch with my friend Tom from
Distilled to see if he wanted to contribute.
Hes been out in Vegas, but came back with a
tip to solve the problem of Google caching a
result for around two hours at a time:
Google docs will cache a URL for ~2
hours and so if you want to crawl a URL
more often than that then you need to add
a modifier to the URL.
I use int(now()*1000) to generate a
unique timestamp and then add that into
the URL in a dummy query string. E.g.
http://www.google.com
/search?q=seattle+seo+consulting&
pws=0&gl=us&time=1354333
The search results wont change when
you change the time value but Google
docs will treat it as a fresh URL and
crawl it again.
Also you can do lots of amazingly fancy
things using Google Scripts (kind of like
macros for google docs) but dont have a
huge amount of time to go into detail
bu i l t v i s i b le
Learn More
Builtvisible are a team of specialists who
love search, SEO and creating content
marketing that communicates ideas and
builds brands.
To learn more about how we can help you,
take a look at the services we offer.
Stay Updated
Enter your email
Join Now
Follow: | | |
Tags: How To | Categories: Research,
Technical
28 thoughts on How To
Use ImportXML in
Google Docs
Sam Hamilton
17TH NOVEMBER 2010 AT
11:28
bu i l t v i s i b le
/en-gb/excel-help/import-xml-dataHP010206405.aspx
Matthew Brookes
17TH NOVEMBER 2010 AT
13:28
Hi Richard,
nice article pretty straight forward but still
good to get some ideas of what you can do.
And you can always export to Excel.
Have you taken a look at the Google refine
product? i have been playing with it but a
lack memory is causing me issues its quiet
good at quickly filtering data or looking for
trends and you can pull data into it as well.
Something else to have a look at is DataSift
(from the team at TweetMeMe) as that looks
to open up a lot of twitter mashing
possibilities.
richardbaxterseo
17TH NOVEMBER 2010 AT
13:37
bu i l t v i s i b le
richardbaxterseo
17TH NOVEMBER 2010 AT
13:40
Hey Sam,
Not that easy if you want to form multiple
columns, concatenating different queries to
form varying URLs for the appropriate
XML response it is still a bit of a pain! You
have to create a data file and its such a
mess around compared to Google Docs. If
you have an example though upload the
file and lets take a look. Id be delighted to
learn!
cart2mobile
17TH NOVEMBER 2010 AT
13:42
bu i l t v i s i b le
19:52
James Morell
18TH NOVEMBER 2010 AT
13:24
Jemima
18TH NOVEMBER 2010 AT
15:16
Finding Keywords
25TH NOVEMBER 2010 AT
04:46
bu i l t v i s i b le
13:37
Matt
26TH JANUARY 2011 AT 21:27
Matt
27TH JANUARY 2011 AT 17:59
Red
5TH MARCH 2011 AT 00:07
bu i l t v i s i b le
Mihai C.
24TH MARCH 2011 AT 12:28
bu i l t v i s i b le
WMG
16TH JUNE 2011 AT 12:00
WMG
bu i l t v i s i b le
too:
http://www.google.com/support/forum
/p/Google%20Docs
/thread?tid=19733fc7fb48ecd5&hl=en
Theres a few tidbits there for anyone
seeking help not sure how useful these are
as yet
Ryan Boots
27TH JULY 2011 AT 14:32
richardbaxterseo
27TH JULY 2011 AT 16:04
Awesome! Tweeted
Jeremy
11TH AUGUST 2011 AT 17:04
bu i l t v i s i b le
Wikiopens
18TH OCTOBER 2011 AT 04:13
Red
18TH OCTOBER 2011 AT 09:43
Saul
19TH DECEMBER 2011 AT 15:20
bu i l t v i s i b le
Maire
28TH DECEMBER 2011 AT
20:23
bu i l t v i s i b le
//tr[td/text()[contains(.,3 month)]]/td[2] 3
month volume
//tr[td/text()[contains(.,10 day)]]/td[2] 10
day volume
Maire
29TH DECEMBER 2011 AT 18:54
Ragu
17TH MARCH 2012 AT 00:00
Bob Jones
15TH JUNE 2012 AT 04:04
Dave
14TH AUGUST 2012 AT 22:45
bu i l t v i s i b le
Bilal AHmed
15TH OCTOBER 2015 AT 13:36
Hy Friends,
Need Some Help.
In Import XML feature of Google Sheets
Using This Code
=importxml(A1,//div[@class=detail])
from the link http://www.fabingo.com
/-english-p-500.html
I get that value BookFort EXPORT ED
(English)Author:Bernard
CornwellISBN:0007331754ISBN13:9780007331758Binding:PaperbackPublishing
Date:2011 MayPublisher:HarperCollins
PublishersLanguage:EnglishNumber Of
pages:400Dimensions:6.81,4.25Weight:272
grams
Dealsnoffers.pk Test Sheet:
https://docs.google.com/spreadsheets
/d/1LkFFa3AO9fKHjI3knJWBzoPh6_YjApskYnq0feNXWpM
/edit#gid=0
bu i l t v i s i b le
Leave a Reply
Your email address will not be published. Required
fields are marked *
Comment
Name *
Email *
Website
Post Comment
Related posts:
bu i l t v i s i b le
Product Vocabularies for Online Retailers
[Structured Data & Microformats]
Extract Your Competitor Keyword Strategy
[Excel Skills]