The elementsoap.ElementGoogle Module

This module implements a client for Google's Web API.

For more information on this API, see http://www.google.com/apis/.

Module Contents

GoogleService(key, url=None) (class) [#]

Google service client.

key
Google license key.
url
Optional service URL. The default is the standard Google endpoint.

For more information about this class, see The GoogleService Class.

The GoogleService Class

GoogleService(key, url=None) (class) [#]

Google service client. To talk to the Google Web API, create an instance of this class, and call the appropriate methods. This class will forward you calls to the Google server.

key
Google license key.
url
Optional service URL. The default is the standard Google endpoint.

doGetCachedPage(url) [#]

Gets a cached version of a page.

url
The page URL.
Returns:
A string containing the page contents.
Raises SoapError:
If the server doesn't like the request.

doGoogleSearch(query, start=0, maxResults=10) [#]

Searches Google.

query
The query string.
start
First result to return.
maxResult
Maximum number of results to return (max 10).
Returns:
An element structure containing the result set.
Raises SoapError:
If the server doesn't like the request.

doSpellingSuggestion(phrase) [#]

Gets an alternate spelling of a word or phrase.

phrase
The original word or phrase.
Returns:
A string containing the alternate spelling, or None.
Raises SoapError:
If the server doesn't like the request.

pyGoogleSearch(query, start=0, maxResults=10) [#]

Same as doGoogleSearch, but returns a Python object structure.

query
The query string.
start
First result to return.
maxResult
Maximum number of results to return (max 10).
Returns:
An Python object describing the result set.
Raises SoapError:
If the server doesn't like the request.