예제 #1
0
def from_livetimer(hxs,hours,minutes):
    try:
        hours = int(data_extractor.extractNumericXpath(hxs,hours))
        mins = int(data_extractor.extractNumericXpath(hxs,minutes))
    except:
        hours = None
        mins = None
    return from_timeleft(hoursleft=hours,minutesleft=mins)
예제 #2
0
 def extract_worth(spider,hxs,response):
     return data_extractor.extractNumericXpath(hxs,"//table[@class='savings']//td[2]//text()") +\
     data_extractor.extractNumericXpath(hxs,"//span[@class='price']//text()")
예제 #3
0
 def extract_expiry(spider,hxs,response):
     timeleft = data_extractor.extractNumericXpath(hxs,"//input[@id='currentTimeLeft']/@value")
     now = time.time()
     return timeleft/1000 + now
예제 #4
0
 def extract_expiry(spider,hxs,response):
     secsLeft = data_extractor.extractNumericXpath(hxs,"//span[@class='js-time hide']//text()")
     print '\n\n\n\nsecs left: ',secsLeft,' current time: ',time.time()
     print '  expiry:: ',secsLeft+time.time(),'\n\n\n'
     return expiry_resolver.from_timeleft(secondsleft=secsLeft)
예제 #5
0
 def extract_expiry(spider,hxs,response):
     curtime = data_extractor.extractNumericXpath(hxs,"//div[@class='deal-timeleft']/@curtime")
     diff = data_extractor.extractNumericXpath(hxs,"//div[@class='deal-timeleft']/@diff")
     return int((curtime + diff)/1000)
예제 #6
0
 def extract_worth(spider,hxs,response):
     price = data_extractor.extractNumericXpath(hxs,"//div[@class='d-price-value']/text()")
     savings = data_extractor.extractNumericXpath(hxs,"//div[@class='d-discount-price']//text()")
     return price + savings
예제 #7
0
 def extract_expiry(spider,hxs,response):
     curtime = data_extractor.extractNumericXpath(hxs,"//div[@id='deal-timeleft']/@curtime")
     timeleft = data_extractor.extractNumericXpath(hxs,"//div[@id='deal-timeleft']/@diff")
     return (curtime+timeleft)/1000