From d92abb50d218af88481ca952a17c6c6be6f8e1c1 Mon Sep 17 00:00:00 2001 From: Marvin Zhang Date: Sun, 23 Jun 2019 20:57:22 +0800 Subject: [PATCH] updated xueqiu spider --- spiders/xueqiu/xueqiu/pipelines.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spiders/xueqiu/xueqiu/pipelines.py b/spiders/xueqiu/xueqiu/pipelines.py index 16753bb6..a5f9c02b 100644 --- a/spiders/xueqiu/xueqiu/pipelines.py +++ b/spiders/xueqiu/xueqiu/pipelines.py @@ -11,10 +11,10 @@ from pymongo import MongoClient class XueqiuPipeline(object): mongo = MongoClient( - host='localhost', - port=27017 + host=os.environ.get('MONGO_HOST') or 'localhost', + port=int(os.environ.get('MONGO_DB')) or 27017 ) - db = mongo['crawlab_test'] + db = mongo[os.environ.get('MONGO_DB') or 'crawlab_test'] col = db.get_collection(os.environ.get('CRAWLAB_COLLECTION') or 'results_xueqiu') def process_item(self, item, spider):