Skip to main content

Scrapy extension to store info in storage service

Project description

PyPI Version Build Status

A scrapy extension to store requests and responses information in storage service.

Installation

You can install scrapy-pagestorage using pip:

pip install scrapy-pagestorage

You can then enable the middleware in your settings.py:

SPIDER_MIDDLEWARES = {
    ...
    'scrapy_pagestorage.PageStorageMiddleware': 900
}

How to use it

Enable extension through settings.py:

PAGE_STORAGE_ENABLED = True
PAGE_STORAGE_ON_ERROR_ENABLED = True

Configure the exension through settings.py:

PAGE_STORAGE_MODE = "VERSIONED_CACHE"
PAGE_STORAGE_LIMIT = 100
PAGE_STORAGE_ON_ERROR_LIMIT = 100
PAGE_STORAGE_TRIM_HTML = True

The extension is auto-enabled for Portia spiders (SHUB_SPIDER_TYPE=portia).

Settings

PAGE_STORAGE_MODE

Default: None

A string which specifies if the extension will store information using cache store or versioned cache store (set PAGE_STORAGE_MODE=”VERSIONED_CACHE” to use versioned one).

PAGE_STORAGE_LIMIT

An integer to set a limit of visited pages amount to store.

PAGE_STORAGE_ON_ERROR_LIMIT

An integer to set a limit for page errors amount to store.

PAGE_STORAGE_TRIM_HTML

Default: False

Remove whitespace from the start and end of the HTML to reduce file size.

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-pagestorage-0.3.0.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

scrapy_pagestorage-0.3.0-py2.py3-none-any.whl (5.1 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file scrapy-pagestorage-0.3.0.tar.gz.

File metadata

  • Download URL: scrapy-pagestorage-0.3.0.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/2.7.15

File hashes

Hashes for scrapy-pagestorage-0.3.0.tar.gz
Algorithm Hash digest
SHA256 b0d2bea7aa056a14b45e5abd450f57ba600864426e145b928776a7a6db10b1cd
MD5 f90a64c0010c7f5c6a51e2c467bf7ba4
BLAKE2b-256 58ef5101f39d2e36adbed599960bc1a520691d46c1e4ea470f9185f99b99107d

See more details on using hashes here.

File details

Details for the file scrapy_pagestorage-0.3.0-py2.py3-none-any.whl.

File metadata

  • Download URL: scrapy_pagestorage-0.3.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/2.7.15

File hashes

Hashes for scrapy_pagestorage-0.3.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 68fe66c2153aa9b2c85d0d26a160a91fc491b8bde19fc9568691e1d94e710e70
MD5 a7f0e4523af5823b45c072dd3f96a4f6
BLAKE2b-256 b10803e35ae0a8fb011cea49a01c9a7ddadf0ac7be45796ece5ba511532d7d1d

See more details on using hashes here.

Supported by

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