Created
June 16, 2012 05:54
-
-
Save mushfiq/2940127 to your computer and use it in GitHub Desktop.
Sample google crawler
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
'''A sample google search script,you have to install python module "google before running it"''' | |
import sys | |
import time | |
from google import search | |
def do(keyword,stop): | |
count = 0 | |
for url in search(keyword,lang='en',num=10,pause=3): | |
count +=1 | |
print url | |
time.sleep(10) | |
if count == stop: | |
sys.exit("BYE BYE") | |
if __name__=='__main__': | |
do("euro cup",20) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment