1 / 7

Project 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 23 rd , 2011. What is xgoogle ?.

marge
Download Presentation

Project 1

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