Skip to main content

scrapy-scraperapi-middleware

scrapy-scraperapi-middleware on pypi
This middleware lets you use Scraper API for every request you process with Scrapy.
You could instead set the proxy field of your request's meta attribute to http://scraperapi.your=options:your_key@proxy-server.scraperapi.com:8001 and enable HttpProxyMiddleware.
This middleware's only purpose is to achieve this in a more convenient manner.

Installation

$ pip install scrapy-scraperapi-middleware

Settings

You need to specify your key for Scraper API in your settings.py or settings object.

SCRAPERAPI_KEY = 'your_key'

You also need to enable ScrapyScraperAPIMiddleware as well as Scrapy's HttpProxyMiddleware.

DOWNLOADER_MIDDLEWARES = {
    'scrapy_scraperapi_middleware.ScrapyScraperAPIMiddleware': 350,
    'scrapy.downloadermiddlewares.httpproxy.HttpProxyMiddleware': 400,
}

Additional options

Scraper API supports additional options as documented here. You could use these options by adding them to your settings as dictionary.

SCRAPERAPI_OPTIONS = {
    'render': 'true', 
    'country_code': 'us'
}

If this example is helpful to you and you do not yet have a subscription to Scraper API, consider using my affiliate link if you plan on getting one. Be aware that all other links to ScraperAPI in this Readme are also affiliate links.

Metadata

Release files for scrapy-scraperapi-middleware 1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for scrapy-scraperapi-middleware 1.0
File Size Uploaded Provenance Actions
scrapy-scraperapi-middleware-1.0.tar.gz 3.4 kB Without provenance Details for scrapy-scraperapi-middleware-1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for scrapy-scraperapi-middleware 1.0
File Interpreter ABI Platform Actions
scrapy_scraperapi_middleware-1.0-py3-none-any.whl Python 3 none any Details for scrapy_scraperapi_middleware-1.0-py3-none-any.whl

Total release size: 7.3 kB

Release files / scrapy-scraperapi-middleware-1.0.tar.gz

Download URL scrapy-scraperapi-middleware-1.0.tar.gz
Size 3.4 kB
Tags Source
SHA-256 checksum
How to use checksums
529ed7eca82a2c2865ff51fb5d54b744bbb80a65cedec45bf5ba86e03aa5ce1a
BLAKE2b-256 checksum
How to use checksums
6648ac1f258a86c8b78182ff0ab3a4409a9e604ec27fb68162b7bf1c64980e90
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.8.11

Release files / scrapy_scraperapi_middleware-1.0-py3-none-any.whl

Download URL scrapy_scraperapi_middleware-1.0-py3-none-any.whl
Size 4.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4ce7c245cca519dd2880d7b0292d8fe1341516a2765d88937477403da234d599
BLAKE2b-256 checksum
How to use checksums
861988b8438d092f63f31cfbe60e48c389a00980064c85d1b1704a820d03806f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.8.11

Security for scrapy-scraperapi-middleware 1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page