yahoo.search.dom.web (version 1.5, Thu Oct 27 10:46:03 PDT 2005) | index /home/leif/hack/pysearch/yahoo/search/dom/web.py

`DOM parser for Web search results
Implement a simple DOM parsers for the Yahoo Search Web Services
web search APIs. This provides parser for the following Web search
classes:
WebSearch - Web Search
ContextSearch - Web Search with a context added
RelatedSuggestion - Web Search Related Suggestion
SpellingSuggestion - Web Search Spelling Suggestion`

Modules

``

yahoo.search.dom |  |  |

Classes

``

yahoo.search.dom.DOMResultParser(yahoo.search.parser.ResultParser)
  RelatedSuggestion
  SpellingSuggestion
  WebSearch

class RelatedSuggestion(yahoo.search.dom.DOMResultParser)
`` | `RelatedSuggestion - DOM parser for Web Related Suggestions Simple related suggestions web service, returning a list of the candidate result strings. Note that the results from this service is slightly different compared to the other services, since each result can only be a string.`

Method resolution order:
  RelatedSuggestion
  yahoo.search.dom.DOMResultParser
  yahoo.search.parser.ResultParser
  __builtin__.object

Methods inherited from yahoo.search.dom.DOMResultParser:

parse_results(self, dom_object)
  `This is a simple DOM parser for all Yahoo Search services. It
  expects to find a top-level node named ResultSet. This is the main
  entry point for the DOM parser, and it requires a properly con-
  structed DOM object (e.g. using minidom).`

Methods inherited from yahoo.search.parser.ResultParser:

__init__(self, service, res_dict=<class 'yahoo.search.parser.ResultDict'>)

__iter__(self)

Data descriptors inherited from yahoo.search.parser.ResultParser:

__dict__
  `dictionary for instance variables (if defined)`

__weakref__
  `list of weak references to the object (if defined)`

firstResultPosition
  `The first result position`

first_result_position
  `The first result position`

results
  `The list of all results`

service
  `The Search Web Service object for this results parser`

totalResultsAvailable
  `Total number of results for the query`

totalResultsReturned
  `The number of results returned`

total_results_available
  `Total number of results for the query`

total_results_returned
  `The number of results returned`

class SpellingSuggestion(yahoo.search.dom.DOMResultParser)
`` | `SpellingSuggestion - DOM parser for Web Spelling Suggestions Simple spell checking web service, there can be only zero or one result from the query. Also note that the results from the search are slightly different compared to the other services, the one (possible) result is just simple string (not a dictionary).`

Method resolution order:
  SpellingSuggestion
  yahoo.search.dom.DOMResultParser
  yahoo.search.parser.ResultParser
  __builtin__.object

Methods inherited from yahoo.search.dom.DOMResultParser:

parse_results(self, dom_object)
  `This is a simple DOM parser for all Yahoo Search services. It
  expects to find a top-level node named ResultSet. This is the main
  entry point for the DOM parser, and it requires a properly con-
  structed DOM object (e.g. using minidom).`

Methods inherited from yahoo.search.parser.ResultParser:

__init__(self, service, res_dict=<class 'yahoo.search.parser.ResultDict'>)

__iter__(self)

Data descriptors inherited from yahoo.search.parser.ResultParser:

__dict__
  `dictionary for instance variables (if defined)`

__weakref__
  `list of weak references to the object (if defined)`

firstResultPosition
  `The first result position`

first_result_position
  `The first result position`

results
  `The list of all results`

service
  `The Search Web Service object for this results parser`

totalResultsAvailable
  `Total number of results for the query`

totalResultsReturned
  `The number of results returned`

total_results_available
  `Total number of results for the query`

total_results_returned
  `The number of results returned`

class WebSearch(yahoo.search.dom.DOMResultParser)

``

`WebSearch - DOM parser for Web Search
Each result is a dictionary populated with the extracted data from the
XML results. The following keys are always available:
Title - The title of the web page.
Summary - Summary text associated with the web page.
Url - The URL for the web page.
ClickUrl - The URL for linking to the page.
The following attributes are optional, and might not be set:
ModificationDate - The date the page was last modified, Unix time.
MimeType - The MIME type of the page.
Cache - The URL of the cached result, and its size.
If present, the Cache value is in turn another dictionary, which will
have the following keys:
Url - URL to cached data.
Size - Size of the cached entry, in bytes.
Example:
results = ws.parse_results(dom)
for res in results:
if res.has_key('Cache'):
print "Cache URL: ", res['Cache']['Url']
`

Method resolution order:
  WebSearch
  yahoo.search.dom.DOMResultParser
  yahoo.search.parser.ResultParser
  __builtin__.object

Methods inherited from yahoo.search.dom.DOMResultParser:

parse_results(self, dom_object)
  `This is a simple DOM parser for all Yahoo Search services. It
  expects to find a top-level node named ResultSet. This is the main
  entry point for the DOM parser, and it requires a properly con-
  structed DOM object (e.g. using minidom).`

Methods inherited from yahoo.search.parser.ResultParser:

__init__(self, service, res_dict=<class 'yahoo.search.parser.ResultDict'>)

__iter__(self)

Data descriptors inherited from yahoo.search.parser.ResultParser:

__dict__
  `dictionary for instance variables (if defined)`

__weakref__
  `list of weak references to the object (if defined)`

firstResultPosition
  `The first result position`

first_result_position
  `The first result position`

results
  `The list of all results`

service
  `The Search Web Service object for this results parser`

totalResultsAvailable
  `Total number of results for the query`

totalResultsReturned
  `The number of results returned`

total_results_available
  `Total number of results for the query`

total_results_returned
  `The number of results returned`

Data
`` |  | __author__ = 'Leif Hedstrom <leif@ogre.com>' __date__ = 'Thu Oct 27 10:46:03 PDT 2005' __revision__ = '$Id: web.py,v 1.5 2005/10/27 18:07:59 zwoop Exp $' __version__ = '$Revision: 1.5 $'

Author
`` |  | Leif Hedstrom <leif@ogre.com>