How to give delay between each requests in scrapy?

后端 未结 6 1066
感情败类
感情败类 2020-12-23 13:29

I don\'t want to crawl simultaneously and get blocked. I would like to send one request per second.

6条回答
  •  无人及你
    2020-12-23 14:11

    There is a setting for that:

    DOWNLOAD_DELAY

    Default: 0

    The amount of time (in secs) that the downloader should wait before downloading consecutive pages from the same website. This can be used to throttle the crawling speed to avoid hitting servers too hard.

    DOWNLOAD_DELAY = 0.25    # 250 ms of delay
    

    Read the docs: https://doc.scrapy.org/en/latest/index.html

提交回复
热议问题