Exemplo n.º 1
0
 def get(self):
     market_score, market_info, money_flow = market_status()
     hot_stock_list, hot_concept_dict = plate_status()
     try:
         stock = str(self.get_argument("stock"))
         select_type = str(self.get_argument("select_type"))
         sub = self.get_argument("sub")
         if sub:
             stock_info = stock_status(stock, stock_type=select_type)
             self.render("index.html",
                         market=[market_score, market_info],
                         money=money_flow,
                         market_hot=[hot_stock_list, hot_concept_dict],
                         stock_self=stock_info,
                         stock_code=stock)
     except:
         print u'获取个股信息失败.'
         stock_info = dict()
         stock_info['basic_score'] = "None"
         stock_info['basic_info'] = "None"
         stock_info['stock_analysis'] = "None"
         stock_info['active_score'] = "None"
         stock_info['active_info'] = "None"
         stock_info['stock_businiess'] = "None"
         stock_info['stock_concept'] = "None"
         stock_info['stock_news'] = "None"
         stock_info['affair'] = "None"
         self.render("index.html",
                     market=[market_score, market_info],
                     money=money_flow,
                     market_hot=[hot_stock_list, hot_concept_dict],
                     stock_self=stock_info,
                     stock_code=u"None")
Exemplo n.º 2
0
 def get(self):
     driver = driver_init()
     market_score, market_info, money_flow, gb_data, hot_info = core_func(
         driver)
     driver.quit()
     try:
         stock = str(self.get_argument("stock"))
         select_type = str(self.get_argument("select_type"))
         sub = self.get_argument("sub")
         if sub:
             driver = driver_init()
             stock_info = stock_status(stock,
                                       driver,
                                       stock_type=select_type)
             driver.quit()
             self.render("index.html",
                         market=[market_score, market_info],
                         research=gb_data,
                         money=money_flow,
                         market_hot=hot_info,
                         stock_self=stock_info,
                         stock_code=stock)
     except:
         print u'获取个股信息失败.'
         stock_info = dict()
         stock_info['basic_score'] = "None"
         stock_info['basic_info'] = "None"
         stock_info['stock_analysis'] = "None"
         stock_info['active_score'] = "None"
         stock_info['active_info'] = "None"
         stock_info['stock_businiess'] = "None"
         stock_info['stock_concept'] = "None"
         stock_info['stock_news'] = "None"
         stock_info['affair'] = "None"
         stock_info['nine_change_index'] = "0"
         stock_info['nine_change_info'] = "None"
         self.render("index.html",
                     market=[market_score, market_info],
                     research=gb_data,
                     money=money_flow,
                     market_hot=hot_info,
                     stock_self=stock_info,
                     stock_code=u"None")