Esempio n. 1
0
 def __init__(self, *a, **kw):
     if kw.has_key("endDate"):
         if TimeUtils.isValidEndDate(kw["endDate"]):
             self.endDate=kw["endDate"]
         else:
             self.logger.error(kw["endDate"]+': error format, must be like 2016-05-15')
             raise CloseSpider(kw["endDate"]+' error format')
         
     self.redis_conn=get_redis_conn()
Esempio n. 2
0
    def __init__(self, *a, **kw):
        if kw.has_key("endDate"):
            if TimeUtils.isValidEndDate(kw["endDate"]):
                self.endDate = kw["endDate"]
            else:
                self.logger.error(kw["endDate"] +
                                  ': error format, must be like 2016-05-15')
                raise CloseSpider(kw["endDate"] + ' error format')

        self.redis_conn = get_redis_conn()
 def __init__(self, *a, **kw):
     if kw.has_key("endDate"):
         if TimeUtils.isValidEndDate(kw["endDate"]):
             self.endDate=kw["endDate"]
         else:
             self.logger.error(kw["endDate"]+': error format, must be like 2016-05-15')
             raise CloseSpider(kw["endDate"]+' error format')
     
     
     self.redis_conn=get_redis_conn()
     #if not self.redis_conn.exists('sina_individual_stock:requests'):
     #    print "set start urls"
     #    self.start_urls = [
     #         "http://vip.stock.finance.sina.com.cn/corp/go.php/vCB_AllNewsStock/symbol/sh600000.phtml",
     #     "http://vip.stock.finance.sina.com.cn/corp/go.php/vCB_AllNewsStock/symbol/sh600004.phtml"
     #     ]
     sha_stock_codes=self.redis_conn.smembers(RedisKeys.SHAStockCode)
     for code in sha_stock_codes:
         url=('http://vip.stock.finance.sina.com.cn/corp/view/vCB_AllNewsStock.php?symbol=sh%s&Page=1' % code)
         self.start_urls.append(url)
Esempio n. 4
0
    def __init__(self, *a, **kw):
        if kw.has_key("endDate"):
            if TimeUtils.isValidEndDate(kw["endDate"]):
                self.endDate = kw["endDate"]
            else:
                self.logger.error(kw["endDate"] +
                                  ': error format, must be like 2016-05-15')
                raise CloseSpider(kw["endDate"] + ' error format')

        self.redis_conn = get_redis_conn()
        #if not self.redis_conn.exists('sina_individual_stock:requests'):
        #    print "set start urls"
        #    self.start_urls = [
        #         "http://vip.stock.finance.sina.com.cn/corp/go.php/vCB_AllNewsStock/symbol/sh600000.phtml",
        #     "http://vip.stock.finance.sina.com.cn/corp/go.php/vCB_AllNewsStock/symbol/sh600004.phtml"
        #     ]
        sha_stock_codes = self.redis_conn.smembers(RedisKeys.SHAStockCode)
        for code in sha_stock_codes:
            url = (
                'http://vip.stock.finance.sina.com.cn/corp/view/vCB_AllNewsStock.php?symbol=sh%s&Page=1'
                % code)
            self.start_urls.append(url)