How to import Google data Using ImportXML

First take a google link like this:
=”http://www.google.com/search?hl=en&gl=US&q=”&a2

In that url http://www.google.com/ is the url we are going to import, Next is /search? is for pulling up the search results page, add in hl=en which is the language code. EN=english, gl=US is helping us get United States Results, for UK we would use gl=UK, q= is your search query ex. cool places in london, cats etc… You can specify the number of results by adding &num=20 or =50,=100. Most importantly, this URL looks like a formula because he adds the =. Also, he adds ” because this is essentially telling G docs that anything in the ” ” is text. When the text finishes he adds the cell reference &a2. This way you can type your next query in A2 and not have to modify the URL again.

Import xml script is

=importxml(C2,”//h3[@class=’r’]/a/@href”)

C2 contains the google search link like

http://www.google.com/search?&q=Legend Of The Cryptids

A2 contains keyword to search on google so C2 will be

=”http://www.google.com/search?&q=”&A2

The result formula is
=importxml(C2,”//h3[@class=’r’]/a/@href”)

import from google.com
import from google.com

Leave a Reply

Your email address will not be published. Required fields are marked *