mingzhou/LogisticsPlatform

数据重复

Brilliant opened this issue · 1 comments

  • problem 某网站大量更新数据,上一个爬虫为结束,下一个爬虫启动,后一个爬虫会重复爬前一个爬虫的数据
  • solution 写入之前检测

another solution 在数据库中建立url的索引,删除冗余选项 db.supply.ensureIndex({"url": -1}, {unique: true, dropDups: true})

weakness 对于相同的url,保留的是最旧的信息,如果网站重复发布同一信息,无法获得更新