Top

Google Search


Python Code
+ 1 likes
Please Register to submit score.
Bookmark and Share
Average Score  5.5 (of 2 scores)
Date Added  Jul 31, 2008
Last Updated  Jul 31, 2008
Tags  google  kaspersky  python  search 

Description

Script that starts a google search with specified criteria.

Grab the Code

import urllib
 
class main(object):
    def addExtension(self):
        search_criteria = raw_input("Insert Google search here: ")
        print \
        print "Searching..."
        webPage = urllib.FancyURLopener({})
        readWeb = webPage.open("http://www.google.com/search?hl=en&q="+search_criteria+"&btnG=Search")
 
    def runIt(self):
        self.addExtension()
 
M = main()
M.runIt()

Comments

  (5)  RSS
bps19882006
Comments: 23
 
Python Snippet:  Google Search
Posted on Aug 18, 2008 4:01 am
nice...nice...
vaseline28
Comments: 162
 
Python Snippet:  Google Search
Posted on Sep 29, 2008 1:02 pm
Nice work :)
Particularly helpful for someone learning Python like me.
armagidon
Comments: 2
 
Python Snippet:  Google Search
Posted on Dec 14, 2008 4:56 am
not work
PATX
Comments: 387
 
Python Snippet:  Google Search
Posted on Apr 26, 2009 6:39 pm
good code... bit sloppy but not too bad. bit pointless but it is a good demenstartion of urllib. gets a 5.
PATX
Comments: 387
 
Python Snippet:  Google Search
Posted on May 28, 2009 2:02 pm
I have a better shorter and faster version...

Code:

import webbrowser

google = raw_input('Google search:')
webbrowser.open_new_tab('http://www.google.com/search?btnG=1&q=%s' % google)



Commenting Options

Register or Login to Hawkee.com or use your Facebook or Twitter account by clicking the corresponding button below.

  

Bottom