def runSpawnList(self, strSite, intPool): ''' 执行协程 列表 ''' qu = queue(self.dicConfig['REDIS_HOST'], self.dicConfig['REDIS_PORT']) while 1: strUrl = qu.spop(self.dicConfig['QUEUE_SINGLE_CP']) if strUrl: # 检测商家 strSite = self.checkSite(strUrl) m = self.importModel('spider', strSite) sp = m.spider() sp.getList(strUrl)
def __init__(self): ''' ''' self.qu = queue(self.dicConfig['REDIS_HOST'], self.dicConfig['REDIS_PORT'])