Google APIs are powerful. You can use python to call these Apis:
1. Google map API
>>> Import urllib and urllib2
>>> Val = {'q': 'New York ', 'sensor': 'false', 'output': 'xml', 'oe ': 'utf-8'} # There is a key option. If you have applied for a key, you can add it. However, you can add both the key and the key in the local test.
>>> Urllib2.urlopen ('HTTP: // maps.google.com/maps/geo? % S' % urllib. urlencode (VAL). Read ()
The XML is as follows:
'<? XML version = "1.0" encoding = "UTF-8"?> \ N <kml xmlns = "http://earth.google.com/km
L/2.0 "> <response> \ n <Name> New York </Name> \ n <status> \ n <code> 200 </code> \ n
<Request> geocode </request> \ n </status> \ n <placemark id = "p1"> \ n <address> N
Ew York, NY, USA </address> \ n <addressdetails accuracy = "4" xmlns = "urn: Oasis: Na
MES: TC: CIQ: xsdschema: xal: 2.0 "> <country> <countrynamecode> us </countrynamecode> <cou
Ntryname> USA </countryname> <administrativearea> <administrativeareaname> ny </admini
Strativeareaname> <subadministrativearea> <subadministrativeareaname> New York </sub
Administrativeareaname> <locality> <localityname> New York </localityname> </locality
> </Subadministrativearea> </administrativearea> </country> </addressdetails> \ n <
Extendeddata> \ n <latlonbox North = "40.8495342" South = "40.5788964" East = "-73.
7498543 "West ="-74.2620919 "/> \ n </extendeddata> \ n <point> <coordinates>-74
. 0059731, 40.7143528, 0 </coordinates> </point> \ n </placemark> \ n </response> </kml> \ n
'
Parse the XML file.
2. Google search API