Esempio n. 1
0
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
Esempio n. 4
0
def GetElement(url, cacheTime=0):
    data = HTTP.Get(url, cacheTime)
    return ElementSoup.parse(data)