添加爬虫数据写入数数脚本
This commit is contained in:
parent
ec446e8fae
commit
fc7d7ee8d7
@ -115,6 +115,10 @@ class CollectMongo():
|
||||
def write2ss(self, data):
|
||||
event_name = self.item.get('event_name')
|
||||
run_false = False
|
||||
try:
|
||||
nums = len(data)
|
||||
except:
|
||||
nums = 0
|
||||
for line in data:
|
||||
if line:
|
||||
for key in line.keys():
|
||||
@ -150,7 +154,7 @@ class CollectMongo():
|
||||
log.error("write {}_{} event error! {}\n".format(event_name, self.tgaid, line))
|
||||
run_false = True
|
||||
if not run_false:
|
||||
log.info("write {}_{} event success!\n".format(event_name, self.tgaid))
|
||||
log.info("write {}_{} num={} success!\n".format(event_name, self.tgaid, nums))
|
||||
|
||||
|
||||
def run(self):
|
||||
@ -159,6 +163,7 @@ class CollectMongo():
|
||||
|
||||
|
||||
def read_mongo(start_date, end_date):
|
||||
print(f"start ={start_date},end={end_date}")
|
||||
all_type = []
|
||||
reptile_4_1 = {}
|
||||
reptile_4_1['db'] = "taptap"
|
||||
|
Loading…
x
Reference in New Issue
Block a user