Skip to main content

This package provides a way to let you set different delay for different website, using the Scrapy framework.

Project description

Scrapy-Custom-Delay

PyPI PyPI - Python Version

Scrapy-Custom-Delay is a package that lets you set different delay for different website, using the Scrapy framework.

Install

$ pip install scrapy-custom-delay

Usage

Step 1: Use the following config values in your scrapy settings:

  1. Enable the AutoThrottle extension.

    AUTOTHROTTLE_ENABLED = True
    
  2. Enable the Custom Delay Throttle by adding it to EXTENSIONS.

    EXTENSIONS = {
        'scrapy.extensions.throttle.AutoThrottle': None,
        'scrapy_domain_delay.extensions.CustomDelayThrottle': 300,
    }
    
  3. Add {'regex': 'download delay (in seconds)'} to the DOMAIN_DELAYS.

    something like:

    # set up custom delays per domain
    # if two or more regexes satisfy, the first one will be used
    DOMAIN_DELAYS = {
        r'^images.google.com*$': 1.0,
        r'*github*': 0.5,
    }
    

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

scrapy-custom-delay-0.0.2.tar.gz (2.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

scrapy_custom_delay-0.0.2-py3-none-any.whl (2.7 kB view details)

Uploaded Python 3

File details

Details for the file scrapy-custom-delay-0.0.2.tar.gz.

File metadata

  • Download URL: scrapy-custom-delay-0.0.2.tar.gz
  • Upload date:
  • Size: 2.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.8

File hashes

Hashes for scrapy-custom-delay-0.0.2.tar.gz
Algorithm Hash digest
SHA256 09bf394ede3602b316b143df1e634959c0f235f0fdc9d3f3b56cadb7be99978a
MD5 4bdf6158a0a916affe5c3498862de195
BLAKE2b-256 c35f8010bf9382f1fd8821696928e884800cc8febb5fc306a7a04818993aa437

See more details on using hashes here.

File details

Details for the file scrapy_custom_delay-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for scrapy_custom_delay-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f0cc8de6c5b744943893adb922b369f40bc412f8a65f7aa1a5d0f2574f62b590
MD5 338a8f7c13c1d52338cb4a4cedc31fec
BLAKE2b-256 950db79a2a22fa9a5638359ca1a5d4f9f90cd9765074e24530c18df8b2a567e9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page