Skip to main content

scrapy-hrequests

A Scrapy download handler that uses hrequests instead of Scrapy's default HTTP downloader. This allows you to use hrequests seamlessly within your existing Scrapy spiders without changing your crawling logic.

Features

  • Simple integration with Scrapy
  • Supports both HTTP and HTTPS requests
  • Drop-in replacement for Scrapy's default download handler
  • Uses the hrequests library for making requests

Installation

pip install scrapy-hrequests

Usage

Configure your spider (or project) to use the HRequestsDownloadHandler.

Per Spider

import scrapy

class ExampleSpider(scrapy.Spider):
    name = "example"

    custom_settings = {
        "DOWNLOAD_HANDLERS": {
            "http": "scrapy_hrequests.handler.HRequestsDownloadHandler",
            "https": "scrapy_hrequests.handler.HRequestsDownloadHandler",
        },
    }

    start_urls = [
        "https://httpbin.org/get",
    ]

    def parse(self, response):
        yield {
            "url": response.url,
            "status": response.status,
        }

Project Wide

Add the following to your settings.py:

DOWNLOAD_HANDLERS = {
    "http": "scrapy_hrequests.handler.HRequestsDownloadHandler",
    "https": "scrapy_hrequests.handler.HRequestsDownloadHandler",
}

Requirements

  • Python 3.8+
  • Scrapy
  • hrequests

License

MIT License

Metadata

Release files for scrapy-hrequests 0.1.9

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-hrequests 0.1.9
File Size Uploaded Provenance Actions
scrapy_hrequests-0.1.9.tar.gz 3.0 kB Without provenance Details for scrapy_hrequests-0.1.9.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for scrapy-hrequests 0.1.9
File Interpreter ABI Platform Actions
scrapy_hrequests-0.1.9-py3-none-any.whl Python 3 none any Details for scrapy_hrequests-0.1.9-py3-none-any.whl

Total release size: 6.3 kB

Release files / scrapy_hrequests-0.1.9.tar.gz

Download URL scrapy_hrequests-0.1.9.tar.gz
Size 3.0 kB
Tags Source
SHA-256 checksum
How to use checksums
7eedead1816b990c143769ae239c1d764302c1904f625384d18448dc5e51fc84
BLAKE2b-256 checksum
How to use checksums
061e4c4daf9c47cf82a9b85db17cc13b0445458ecd702e5e96eddf2f53c7344b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / scrapy_hrequests-0.1.9-py3-none-any.whl

Download URL scrapy_hrequests-0.1.9-py3-none-any.whl
Size 3.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b91099c897be1386429afc30324cd9ce31bed9782baf85c0ed618d1715276c17
BLAKE2b-256 checksum
How to use checksums
fc78dc8f7389cf7047b1fa65a2169242a9d916c2c7b04581cf013b4456e22e02
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Security for scrapy-hrequests 0.1.9

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