这是一个创建于 2659 天前的主题,其中的信息可能已经有所发展或是发生改变。
我大致看了下源码,每个 project 有一系列 task,task 的流程大概是:
scheduler 从 new_task_queue 取 task 放到出队列 -> fetcher 执行 task 后把结果放到出队列 -> processor 把结果传给用户定义的 handler, 从中提取新的 task 放到 new_task_queue
把 task 放到数据库是在 scheduler 取 task 的时候.如果在 processor 执行完后,设状态为 stop,这时候 scheduler 检测到爬虫停止了,是不会把 new_task_queue 中的 task 放到数据库的,这样会不会有丢失 task 的可能?
3 条回复 • 2017-11-14 12:12:20 +08:00
 |
|
1
golmic 2017-11-14 11:46:29 +08:00
不建议用 pyspider,很多坑。用 scrapy 吧
|
 |
|
2
cheesea 2017-11-14 12:11:47 +08:00
没有用,我只是在学习它的源码,和 scrapy 相互比较.
|
 |
|
3
cheesea 2017-11-14 12:12:20 +08:00
@ golmic 没有用,我只是在学习它的源码,和 scrapy 相互比较.
|