import requests, time,math

def getCollection(resfile):
    try:
        fo=open(resfile,"w+")
        error_log = open('arxerrlog.txt', 'w+')
        #working url https://archive.org/advancedsearch.php?q=description%3A%282020010006604%29+AND+collection%3A%28digitallibraryindia%29&fl%5B%5D=identifier&sort%5B%5D=&sort%5B%5D=&sort%5B%5D=&rows=50&page=1&output=json&&save=yes
        urlpb="https://archive.org/advancedsearch.php?q=%28collection%3Adigitallibraryindia+AND+%28language%3Atel++OR+language%3ATelugu%29%29&fl%5B%5D=description&rows=50&start="
        start=0
        urlpe="&output=json&save=yes
        params={}
        catalog={}
        page=0
        try:
            url=urlpb+str(start)+urlpe
            print (url)
            resp = requests.get(url, headers=params)
        except requests.exceptions.RequestException as e:  # This is the correct syntax
            error_log.write('Could not get search result' + bc + ' because of error: %s\n' % e)
            print
                "There was an error; writing to log."
            sys.exit(1)
        else:
            data=resp.json()
            maxpages=math.ceil(data["response"]["numFound"]/50)
            for page in 0:maxpages:
                start=page*50
                try:
                    url=urlpb+str(bc)+urlpe
                    print (url)
                    resp = requests.get(url, headers=params)
                except requests.exceptions.RequestException as e:  # This is the correct syntax
                    error_log.write('Could not get search result' + bc + ' because of error: %s\n' % e)
                    print
                        "There was an error; writing to log."
                    sys.exit(1)
                else:
                    print
                    "fetching " + page+ " 

                    data = resp.json()
                    catalog= catalog+ data["response"]["docs"]
                time.sleep(1)
            print(catalog,fo)
            fclose(fo)
    except IOError:
        print ("Error: can\'t find file or read data")
  File "<ipython-input-3-28cbcda9624a>", line 10
    urlpe="&output=json&save=yes
                                ^
SyntaxError: EOL while scanning string literal
search_orders()
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-2-fa876d3e4dcb> in <module>()
----> 1 search_orders()

TypeError: search_orders() missing 1 required positional argument: 'self'