|
@@ -49,7 +49,7 @@ def save(documents, collection, ordered=False):
|
|
|
data_lst.append(item)
|
|
|
if len(data_lst) == 100:
|
|
|
ret = collection.insert_many(data_lst, ordered)
|
|
|
- logger.info(f"MongoDB {collection.name} 保存 {len(ret)} 条数据")
|
|
|
+ logger.info(f"MongoDB {collection.name} 保存 {len(ret.inserted_ids)} 条数据")
|
|
|
data_lst = []
|
|
|
|
|
|
if data_lst:
|
|
@@ -223,7 +223,12 @@ def zgzb_crawl_aggregate_of_list_pages(datestr=None):
|
|
|
logger.info("中国招标投标公共服务平台 - 数据汇总完成")
|
|
|
|
|
|
|
|
|
-if __name__ == '__main__':
|
|
|
+def start_summary():
|
|
|
feapder_crawl_aggregate_of_list_pages()
|
|
|
competing_products_crawl_aggregate_of_list_pages()
|
|
|
zgzb_crawl_aggregate_of_list_pages()
|
|
|
+ logger.info("数据汇总完成")
|
|
|
+
|
|
|
+
|
|
|
+if __name__ == '__main__':
|
|
|
+ start_summary()
|