Skip to main content

No project description provided

Project description

scrapy-kit

A library for scrapy tools, including but not limited to the usual pipelines, middlewares, etc.

install

pip install scrapy-kit

usage

pipelines

mongo pipeline

A pipeline saved into MongoDB asynchronously with txmongo

use database db.createUser( { user: "username", pwd: "password", roles: [ { role: "readWrite", db: "database" } ] } )

how use:

  1. add to settings.py
ITEM_PIPELINES = {
    'scrapy_kit.pipelines.MongoPipeline': 300,
}
  1. add mongo config to settings.py
MONGO_URI = "mongodb://username:password@host:port"
MONGO_DATABASE_NAME = "database"
MONGO_COLLECTION_NAME = "collection"

middlewares

proxy connection close middleware

Proxy close connection multiplexing middleware

Tunnel Proxy Dynamic Edition request found that the number of requests in the Personal Centre Tunnel Proxy Usage Statistics is very small, which is seriously inconsistent with the real number of requests. Moreover, there is no IP change when using Tunnel Broker Dynamic Edition. The reason for this is that the tunnel sends requests that reuse previously established connections. You need to add Connection: close to the header.

How to use it:

  1. Add in settings.py:
DOWNLOADER_MIDDLEWARES = {
    'scrapy_kit.middlewares.ProxyConnectionCloseMiddleware': 543,
}

development

git clone
cd scrapy-kit
poetry install

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_kit-0.1.12.tar.gz (11.5 kB view details)

Uploaded Source

Built Distribution

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

scrapy_kit-0.1.12-py3-none-any.whl (12.6 kB view details)

Uploaded Python 3

File details

Details for the file scrapy_kit-0.1.12.tar.gz.

File metadata

  • Download URL: scrapy_kit-0.1.12.tar.gz
  • Upload date:
  • Size: 11.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.10.12 Linux/6.2.0-1012-azure

File hashes

Hashes for scrapy_kit-0.1.12.tar.gz
Algorithm Hash digest
SHA256 8c48b948a4d7df9e5e5f423c773aba51b74a8306b37d6a6248319364aaac21e4
MD5 208b32e1351e680180bb0e5210c71147
BLAKE2b-256 092d7c2ee65a59f8be15ebe49510c8dfc20b68cc6779ba29c66950ae243ee45b

See more details on using hashes here.

File details

Details for the file scrapy_kit-0.1.12-py3-none-any.whl.

File metadata

  • Download URL: scrapy_kit-0.1.12-py3-none-any.whl
  • Upload date:
  • Size: 12.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.10.12 Linux/6.2.0-1012-azure

File hashes

Hashes for scrapy_kit-0.1.12-py3-none-any.whl
Algorithm Hash digest
SHA256 870500546f9e66e64c1901f3348713716e831e6fc7e30881ff600c1585f88ba0
MD5 e1d60b55151134f0fa82224d96130ee1
BLAKE2b-256 8f6ba1e22d2d68fc470cdbb8499c5b38cd8fdc2fe46baf4bcf1d7a499705a4d8

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