I am not a developer. But learning how to use ImportXML has been one of the most interesting things I’ve done in the past few weeks.
If you haven’t heard of ImportXML yet, or just haven’t got around to using it, you need to learn it now.
– It’s not very hard
– It’s free and awesome
– It will save you tons of time if you do any work online and make you very happy! Yaaay
Assuming you work in the internet field, learning to code, even at a beginner/intermediate level, is a very valuable skill to have. You might never be the one writing complicated programs for your company, but you will understand what goes into it and how it works. Plus you’ll be able to create smaller “agile” tools that can make your life easier.
Pro tip: Learning a skill or theory is great, but applying it directly to one of your problems is the secret. It’s great to learn how to show all the dog breads in Gdocs using ImportXML, but you will most likely forget all the details of how it works once your done if you aren’t using it in your day-to-day activities.
Let’s get started..
ImportXML is a functionality inside Google Docs that allows you to make calls or queries out on the internet, without ever leaving the spreadsheet.
Lots of SEOs have written posts on how to build agile tools to get SEO work done, but ImportXML isn’t bias to the SEO world, you can do almost anything you can imagine with it.
Note : I’ve made a reference list at the end of this post for more on ImportXML with SEO
So let’s dig in… I’m going to show you how I helped my wife save hours for an assignment her boss wanted: Build a spreadsheet with every country, their population, GDP, & other data from multiple data sources online
– Create a list of every country from CIA’s World Factbook.
– Get the page URL extension
– Get the full page URL
– Get the population
So we’re starting with this :
And need it to look like this :
She was going to do it by searching manually for this field
on 300+ pages, then copying all the information by hand!
Which made me say noooooooooooo!
So the fist step once you’re in Google Docs is to add the URL you’ll be using to cell A1. That way you can easily call on that URL in the ImportXML query with (A1,xxx) instead of (http://theurlIwant.com,xxx)
The first function we’re going to do with ImportXML is
So how did I come up with that? Well you need to look at the data you need on the page then find it in the source code.
equals this in HTML