def getRanking(isbn): #Take ISBN,create finalURL and then call urlopen on it page = uopen( '%s%s' % (AMZN, isbn)) #or str.format() i.e. '{0}{1}'.format(AMZN,isbn) data = page.read() page.close() return REGEX.findall(data)[0]
def getRanking(isbn): print '%s%s' % (AMZN, isbn) page = uopen('%s%s' % (AMZN, isbn)) # '{0}{1}'.format(AMZN, isbn)) for 2.6+ data = page.read() page.close() return REGEX.findall(data)[0]
def getRanking(isbn): print("%s%s" % (AMZN, isbn)) #通过这个方式,形成完整的URL page = uopen('%s%s' % (AMZN, isbn)) data = page.read() page.close() return REGEX.findall(data)[0]
def getRanking(isbn): try: page = uopen("%s%s" % (AMIZ, isbn)) # or str.format data = page.read() return REGEX.findall(data)[0] except: return None finally: if page in locals(): page.close()
def getRanking(isbn): page = uopen('%s%s' % (AMZN, isbn)) data = page.read() print data page.close() return REGEX.findall(data)[0]
def getRanking(isbn): #Take ISBN,create finalURL and then call urlopen on it page = uopen('%s%s'%(AMZN,isbn)) #or str.format() i.e. '{0}{1}'.format(AMZN,isbn) data = page.read() page.close() return REGEX.findall(data)[0]
def getRanking(isbn): page = uopen('%s%s' % (AMZN, isbn)) data = page.read() page.close() return REGEX.findall(data)[0]
def getRanking(isbn): page = uopen("%s%s" % (AMZN, isbn)) # '{0}{1}'.format(AMZN, isbn)) for 2.6+ data = page.read() page.close() return REGEX.findall(data)[0]
def getRanking(isbn): page = uopen('%s%s' %(AMZN, isbn)) # or str.format() data = page.read() page.close() return REGEX.findall(data)[0]
def getRanking(isbn): page = uopen("%s%s" % (AMZN, isbn)) data = page.read() page.close() #print data return REGEX.findall(data)[0]
def getRanking(isbn): page = uopen('%s%s' % (AMZN, isbn)) # or str.format() data = page.read() #print data page.close() return REGEX.findall(data)[0]
def getRanking(isbn): page = uopen('%s%s' % (amzn, isbn)) data = page.read() page.close() print regex.findall(data)