1 / 7

Introduction to xGoogle: A Python Library for Google Search Integration

The xGoogle library offers a powerful solution for conducting Google searches without the constraints of the official API. This Python library allows developers to bypass API limitations, enabling a larger number of search queries. By utilizing Beautiful Soup for HTML parsing, xGoogle retrieves search results in a clean text format (UTF-8). Key functionalities include fetching results pages, setting the number of results per page, and implementing the SearchBase class for custom subclasses. For practical applications, reference the provided SportsSearch.py example. Discover the ease of using xGoogle for your web projects!

marge
Télécharger la présentation

Introduction to xGoogle: A Python Library for Google Search Integration

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Project 1 Participation Page: http://tw.rpi.edu/web/Courses/WebSci/2011/ParticipationPage Direct Link to code snippet: http://tw.rpi.edu/media/latest/project1.zip Using the xgoogle library Dan Rotondo Web Science September 23rd, 2011

  2. What is xgoogle? A Python library for Google Search Avoids having to use the Google API Less limitations on number of search queries http://www.catonmat.net/blog/python-library-for-google-search/

  3. What does it do? Gets the Google website with your search results Use’s Beautiful Soup to parse the HTML code (http://www.crummy.com/software/BeautifulSoup/) Returns the results in text format (utf8)

  4. Some of xgoogle’s methods/properties 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

  5. How to use it SearchBase.py interfaces with xgoogle Must implement this class with any of your subclasses

  6. Example Implementation 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: http://docs.python.org/library/abc.html

  7. Things to note 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!

More Related