Skip to main content

Scrapy extension to store info in storage service

Project description

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.2.1.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

scrapy_pagestorage-0.2.1-py2-none-any.whl (5.5 kB view details)

Uploaded Python 2

File details

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

File metadata

File hashes

Hashes for scrapy-pagestorage-0.2.1.tar.gz
Algorithm Hash digest
SHA256 b6958d4831623a2aa8822f3b3b27274a42a158cde6b477608c3687ac4fa75eba
MD5 709194565ac79d198ff62e6f641f878f
BLAKE2b-256 638d8757617b10190b1dc3b7858a08dabe7836f0a403c749112c66e615813fa9

See more details on using hashes here.

File details

Details for the file scrapy_pagestorage-0.2.1-py2-none-any.whl.

File metadata

File hashes

Hashes for scrapy_pagestorage-0.2.1-py2-none-any.whl
Algorithm Hash digest
SHA256 02263dfa54f1a78287c05534f3c5593675d92e54f34403b49573be708ef0e18d
MD5 d4ebec447e54b34951f605e37ee6cd47
BLAKE2b-256 add371d9d694f97c12175a10a7990b836dba9d42258c5e55226abb414531df58

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