def GetElement(url, cacheTime=0): data = HTTP.Get(url, cacheTime) print data if data == "": time.sleep(2) data = HTTP.Get(url, 0) return ElementSoup.parse(data)
def getPageElements(url): print 'FETCHING: ' + url if url in cache: print 'Cache found' page = cache[url] else: print 'No cache, fetching page' page = ElementSoup.parse(HTTP.Get(url)) cache[url] = page return page
def getPageElements(url): print 'FETCHING: '+url if url in cache: print 'Cache found' page = cache[url] else: print 'No cache, fetching page' page = ElementSoup.parse(HTTP.Get(url)) cache[url] = page return page
def GetElement(url, cacheTime=0): data = HTTP.Get(url, cacheTime) return ElementSoup.parse(data)