for a search  query i need  the links along with the brief text from
that link that you get on the google search result page.
i need a python script for this  !
could nebody please suggest some way !
i tried this code but it only results the links :


import urllib
import simplejson
def google_results(search_query):
  query = urllib.urlencode({'q' : search_query})
  url_list=[]
  url=[]
  url = 'http://ajax.googleapis.com/ajax/services/search/web?
rsz=large&start=0&v=1.0&%s'% (query)
  search_results = urllib.urlopen(url)
  json = simplejson.loads(search_results.read())
  results = json['responseData']['results']
  for i in results:
    #print i['title'] + ": " + i['url']+"\n"
    url_list.append(i['url'])
  #print url_list
  return url_list
y=raw_input('Enter query :')
x= google_results(y)
print x

-- 
You received this message because you are subscribed to the Google Groups 
"Google AJAX APIs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-ajax-search-api?hl=en.

Reply via email to