Skip to content

Instantly share code, notes, and snippets.

@bongbongco
Created October 23, 2016 23:22
Show Gist options
  • Save bongbongco/fce3103c49f03a43ae97a5fdd80533c1 to your computer and use it in GitHub Desktop.
Save bongbongco/fce3103c49f03a43ae97a5fdd80533c1 to your computer and use it in GitHub Desktop.
from py_bing_search import PyBingWebSearch
search_term = "Python Software Foundation"
bing_web = PyBingWebSearch('Your-Api-Key-Here', search_term, web_only=False) # web_only is optional, but should be true to use your web only quota instead of your all purpose quota
first_fifty_result= bing_web.search(limit=50, format='json') #1-50
second_fifty_result= bing_web.search(limit=50, format='json') #51-100
print (second_fifty_result[0].description)
u'Python Software Foundation Home Page. The mission of the Python Software Foundation is to promote, protect, and advance the Python programming language, and to ...'
'''
self.title: title of the result
self.url: the url of the result
self.description: description for the result
self.id: bing id for the page
#Meta info:
self.meta.uri: the search uri for bing
self.meta.type: for the most part WebResult
'''
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment