Participation Page: onPage onPage Direct Link to code snippet: Using the xgoogle library Dan Rotondo Web Science September 23 rd, 2011
A Python library for Google Search Avoids having to use the Google API Less limitations on number of search queries library-for-google-search/ library-for-google-search/
Gets the Google website with your search results Use’s Beautiful Soup to parse the HTML code ( tifulSoup/) tifulSoup/ Returns the results in text format (utf8)
method get_results() – gets a page of results (a list of SearchResult objects) property num_results – number of search results found property results_per_page – sets/gets number of results per page property page – sets/gets the search page
SearchBase.py interfaces with xgoogle Must implement this class with any of your subclasses
import abc from SearchBase import SearchBase class YourClassName(SearchBase): [… your code here …] abc stands for Abstract Base Classes. If you’re interested in what they are:
Do not download xgoogle from their website!!! (it’s out of date) Do use the website as a way to familiarize yourself with the library Go over the SportsSearch.py example Have Fun!