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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

scrapy_hrequests-0.1.9.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

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

scrapy_hrequests-0.1.9-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

Details for the file scrapy_hrequests-0.1.9.tar.gz.

File metadata

  • Download URL: scrapy_hrequests-0.1.9.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for scrapy_hrequests-0.1.9.tar.gz
Algorithm Hash digest
SHA256 7eedead1816b990c143769ae239c1d764302c1904f625384d18448dc5e51fc84
MD5 8beab55e62d7c650b72ebd20ea85b826
BLAKE2b-256 061e4c4daf9c47cf82a9b85db17cc13b0445458ecd702e5e96eddf2f53c7344b

See more details on using hashes here.

File details

Details for the file scrapy_hrequests-0.1.9-py3-none-any.whl.

File metadata

File hashes

Hashes for scrapy_hrequests-0.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 b91099c897be1386429afc30324cd9ce31bed9782baf85c0ed618d1715276c17
MD5 67006d274c9be283c114983e8d01a62e
BLAKE2b-256 fc78dc8f7389cf7047b1fa65a2169242a9d916c2c7b04581cf013b4456e22e02

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.9 This release

2 files

0.1.8

2 files

0.1.7

2 files

0.1.6

2 files

0.1.5

2 files

0.1.4

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

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