2

I used scrapyd run scrapy jobs.
And the 127.0.0.1:6800 show the job is finished.
But I open the log,it didn't have error message or finished info like this

{'downloader/request_bytes': 1685,
 'downloader/request_count': 4,
 'downloader/request_method_count/GET': 4,
 'downloader/response_bytes': 172338,
 'downloader/response_count': 4,
 'downloader/response_status_count/200': 4,
 'finish_reason': 'finished',
 'finish_time': datetime.datetime(2015, 1, 7, 0, 7, 32, 480907),
 'log_count/DEBUG': 6,
 'log_count/INFO': 83,
 'request_depth_max': 1,
 'response_received_count': 4,
 'scheduler/dequeued': 4,
 'scheduler/dequeued/memory': 4,
 'scheduler/enqueued': 4,
 'scheduler/enqueued/memory': 4,
 'start_time': datetime.datetime(2015, 1, 7, 0, 6, 32, 32624)} 

This spider have to crawl 4000 links,But it seems like it stop at the 329 link.
How would this happened?

This is my start_urls
I select the links from database(there are 4000 links):

def start_requests(self):
    obj = MTheater.objects.filter(country='US')
    for i in obj:
        link =  i.link
        yield Request(url=link, callback=self.parse)

Please give me some direction,Thank you sou much.

user2492364
  • 6,543
  • 22
  • 77
  • 147
  • How do you know it stopped on 329 link? (I see only 4 requests started). Also, are you sure there are `4000` links for the `US` country? – alecxe Jan 07 '15 at 00:40
  • 1
    no no the finished info is another scrapyd,I just want to show that ther is no info like this in my scrapyd log . I check my database the number stop at 329. But there should be 4000 . – user2492364 Jan 07 '15 at 00:42
  • Thanks. Is the behavior consistent? Every time you run it - it stops at the same place? Also, do the links belong to a same domain? What about using `MTheater.objects.filter(country='US').distinct('link')` instead to filter duplicates?.. – alecxe Jan 07 '15 at 00:45
  • Thank you so much!! I will your advice. by the way,I write cron in ````/etc/crontab```` to run scrapyd. would it be cron jobs's error? – user2492364 Jan 07 '15 at 00:54
  • I don't think so, if anything above didn't help, please add `log.msg(response.url, level=log.INFO)` to the `parse()` callback, see [How to log messages](http://doc.scrapy.org/en/latest/topics/logging.html#how-to-log-messages). Then, run it again. – alecxe Jan 07 '15 at 01:12
  • Thank you!! I found out the problem.It's the memory not enough. I think it 's because I save tmp log in memory when finished it will mail to me. It' to big. still testing now – user2492364 Jan 07 '15 at 08:24

0 Answers0