Esempio n. 1
0
def getValues(item):
	url = item[3]
	print("getValues(): ", url)
	
	d = pq(url=url)
	list = d("[border='0'].listbody td")	

	index = 20
	while index < len(list):	
		try :
			obj = {}
			obj['date'] = list[index].text_content()
			obj['time'] = common.dateStringToTimestamp(obj['date'])
			obj['time'] = common.formatTimestamp(obj['time'])
			obj['user'] = list[index + 1].text_content()
			obj['deposit'] = list[index + 2].text_content().split("/")[0].replace("$", "")
			obj['site_id'] = item[0]
			obj['monitor'] = item[2]		
				
			print("{0} - {1} - {2} - {3} - {4} - {5}".format(obj['site_id'], obj['monitor'], obj['date'], obj['time'], obj['user'], obj['deposit']))
			if common.insertUserRcb(obj) == -1:
				return
		except Exception:
			pass
		index += 5
Esempio n. 2
0
def getValues(item):
	url = item[3]
	print("getValues(): ", url)
	format = "%b %d %Y %H:%M:%S"
	
	d = pq(url=url)
	list = d(".details .list td")	
	
	index = 0
	while index < len(list):			
		try:
			obj = {}
			obj['date'] = common.removeNumberString(list[index].text_content())
			obj['time'] = common.dateStringToTimestamp(obj['date'], format=format)
			obj['time'] = common.formatTimestamp(obj['time'])
			obj['user'] = list[index + 1].text_content()
			obj['deposit'] = list[index + 2].text_content().split("/")[0].replace("$", "")
			obj['site_id'] = item[0]
			obj['monitor'] = item[2]
			
			print("{0} - {1} - {2} - {3} - {4} - {5}".format(obj['site_id'], obj['monitor'], obj['date'], obj['time'], obj['user'], obj['deposit']))
			if common.insertUserRcb(obj) == -1:
				return
		except Exception:
			pass
		index += 5
Esempio n. 3
0
def getValues(item):
    url = item[3]
    print ("getValues(): ", url)

    d = pq(url=url)
    list = d("#content2 table[cellspacing='0'] td")

    index = 6
    while index < len(list):
        try:
            obj = {}
            obj["date"] = list[index].text_content()
            obj["time"] = common.dateStringToTimestamp(obj["date"])
            obj["time"] = common.formatTimestamp(obj["time"])
            obj["user"] = list[index + 1].text_content()
            obj["deposit"] = list[index + 2].text_content().replace("$", "")
            obj["site_id"] = item[0]
            obj["monitor"] = item[2]

            print (
                "{0} - {1} - {2} - {3} - {4} - {5}".format(
                    obj["site_id"], obj["monitor"], obj["date"], obj["time"], obj["user"], obj["deposit"]
                )
            )
            if common.insertUserRcb(obj) == -1:
                return
        except Exception:
            pass

        index += 6
Esempio n. 4
0
def getValues(item):
	url = item[3]
	print("getValues(): ", url)
	format = "%d %b,%Y"
	
	d = pq(url=url)
	list = d(".rcbtable table[width='100%'] td")	
	
	index = 0
	while index < len(list):			
		try:
			obj = {}
			obj['date'] = list[index].text_content()
			obj['time'] = common.dateStringToTimestamp(obj['date'], format=format)
			obj['time'] = common.formatTimestamp(obj['time'])
			obj['user'] = list[index + 1].text_content()
			obj['deposit'] = list[index + 3].text_content().replace("$", "")
			obj['site_id'] = item[0]
			obj['monitor'] = item[2]
			
			print("{0} - {1} - {2} - {3} - {4} - {5}".format(obj['site_id'], obj['monitor'], obj['date'], obj['time'], obj['user'], obj['deposit']))
			if common.insertUserRcb(obj) == -1:
				return
		except Exception:
			pass
		index += 7