Last active
December 20, 2015 01:39
-
-
Save egcodes/6050399 to your computer and use it in GitHub Desktop.
Command line tool for google search
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import urllib2 | |
import sys, re, os | |
from google import search | |
#Get keywords from args | |
if len(sys.argv) < 3: | |
print "Usage:\n python googlecmd.py <keywords> <keywords> ..." | |
exit() | |
searchKeyword = "" | |
for index in range(1, len(sys.argv)): | |
searchKeyword += sys.argv[index] | |
print "Google Cmd" | |
print "==========" | |
for url in search('%s'%searchKeyword, lang='tr', stop=10): | |
try: | |
pass | |
#f = urllib2.urlopen(url, timeout=3).read() | |
except Exception, error: | |
print "Sayfa acilamadi...(%s)"%str(error) | |
continue | |
print url |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment