Example #1
0
    if o == "--cnt":
        n_cnt = int(a)
    if o == "--dir":
        dwn_dir = a.replace('\\',"\\\\")

if query == '':
    print ('python gsrchDwn.py --query [query_text] [--ftype file_extension] [--cnt contine_result_number] [--dir download_dir]')
    sys.exit(2)


try:

    cnt = 0

    gs = GoogleSearch(query)
    gs.filetype = mfiletype
    gs.results_per_page = 50
    pgCnt = 1

    if n_cnt <> 0:
        print "Download Continuing from result number: ",str(n_cnt)

    #import pdb

    lastUrl = None

    while True:
        gs.page = pgCnt
        results = gs.get_results()
        pgCnt = pgCnt +1  #Increase page count to next page