Esempio n. 1
0
 def extract_expiry(spider,hxs,response):
     time = data_extractor.extractXpath(hxs,"//span[@class='datetime']//text()",0)
     print '\n\n\n',time,'\n\n\n' 
     try:
         ret = int(expiry_resolver.from_timestring(time))
     except:
         ret = ""
     return ret
Esempio n. 2
0
 def extract_expiry(spider,hxs,response):
     scripts = data_extractor.extractXpath(hxs,"//script",None,'')
     index = scripts.find("jam1.TargetDate")
     if index:
         timestring = scripts[index+20:index+45]
         print '\n\n\nindex:scripts...{',index,'}\n\n\n{',timestring,'}\n\n\n\n\n'
         try:
             ret = int(expiry_resolver.from_timestring(timestring)) - 8*3600
         except:
             ret = ""
         return ret
     else:
         return None            
Esempio n. 3
0
 def extract_expiry(spider,hxs,response):
     timestring = data_extractor.extractXpath(hxs,"//span[@id='origEnd']/@name")
     timeleft = int(expiry_resolver.from_timestring(timestring)) - 8*3600
     return timeleft