Using the ElementTree Module to Generate Google Requests

November 20, 2003 | Fredrik Lundh

The Google Web API is a SOAP interface to Google’s search service, and a few other services. The ElementSOAP library includes a Python interface for the Google API.

from elementsoap.ElementGoogle import GoogleService

key = getlicensekey()

g = GoogleService(key)

response = g.doGoogleSearch("elementsoap")

for item in response.findall(".//item"):
    print item.findtext("URL"), repr(item.findtext("title"))

For background information and more examples, see the Using the ElementTree Module to Generate SOAP Messages article series, especially part 2, Talking to Google.

 

A Django site. this page was rendered by a django application in 0.02s 2008-12-02 03:20:00.524331. hosted by webfaction.