redsees

Untitled

Dec 19th, 2015
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.41 KB | None | 0 0
  1. #!/usr/bin/env python
  2. import urllib2,urllib,json
  3. url="http://ajax.googleapis.com/ajax/services/search/web?v=1.0&"
  4. query=raw_input("Enter your Search Word here : ")
  5. query = urllib.urlencode({'q':query})
  6. response=urllib2.urlopen(url+query).read()
  7. data=json.loads(response)
  8. results=data['responseData']['results']
  9. for result in results :
  10.     title=result['title']
  11.     url = result['url']
  12.     print (title + "; "+url)
Add Comment
Please, Sign In to add comment