Scrapy声明没有抓取任何页面/项目?

时间:2013-04-18 17:06:24

标签: python logging scrapy

我的蜘蛛正在从网站上抓取一个xml。这样做是成功的,因为我可以看到通过数据库管道存储的项目。

但是,当我查看日志(设置为log.INFO)时,它表示没有抓取任何内容?

2013-04-12 11:58:00-0400 [traffics] INFO: Spider opened
2013-04-12 11:58:00-0400 [traffics] INFO: Crawled 0 pages (at 0 pages/min), scraped 0 items (at 0 items/min)
2013-04-12 11:58:03-0400 [traffics] INFO: Closing spider (finished)
2013-04-12 11:58:03-0400 [traffics] INFO: Dumping Scrapy stats:
    {'downloader/request_bytes': 273,
     'downloader/request_count': 1,
     'downloader/request_method_count/GET': 1,
     'downloader/response_bytes': 28883,
     'downloader/response_count': 1,
     'downloader/response_status_count/200': 1,
     'finish_reason': 'finished',
     'finish_time': datetime.datetime(2013, 4, 12, 15, 58, 3, 469842),
     'log_count/DEBUG': 7,
     'log_count/INFO': 4,
     'response_received_count': 1,
     'scheduler/dequeued': 1,
     'scheduler/dequeued/memory': 1,
     'scheduler/enqueued': 1,
     'scheduler/enqueued/memory': 1,
     'start_time': datetime.datetime(2013, 4, 12, 15, 58, 0, 907300)}
2013-04-12 11:58:03-0400 [traffics] INFO: Spider closed (finished)

为什么在肯定抓取时将0项和0页抓取(并随后将它们保存到数据库中)?

1 个答案:

答案 0 :(得分:1)

数据库管道中的process_item方法是否在存储后返回该项目?