dongzhaorui 3 жил өмнө
parent
commit
cacbf743ca
1 өөрчлөгдсөн 2 нэмэгдсэн , 3 устгасан
  1. 2 3
      ybw/list_spider.py

+ 2 - 3
ybw/list_spider.py

@@ -135,7 +135,7 @@ class ListSpider:
                 "l_np_publishtime": int2long(int(time.mktime(time.strptime(publish_time, "%Y-%m-%d")))),
             }
             if title is None:
-                logger.error(f"[标题异常]{competehref}")
+                logger.error(f"[标题为空]{competehref}")
                 continue
             results.append(item)
 
@@ -143,8 +143,7 @@ class ListSpider:
         for item in results:
             sign = sha1(item['competehref'])
             if not self.r.hexists(self.redis_key, sign):
-                # item['count'] = es_query(item["title"], item["l_np_publishtime"])
-                item['count'] = 0
+                item['count'] = es_query(item["title"], item["l_np_publishtime"])
                 item['crawl'] = False
                 # print(f'>>> {title} - {competehref}')
                 insert_items.append(item)