Skip to main content

scrapy的一个下载中间件,绕过cloudflare检测

Project description

AroayCloudScraper

scrapy一个插件,绕过cloudflare检测,主要是封装 cloudscraper模块,并且将cloudscraper模块在scrapy中异步执行

使用,在setting添加

DOWNLOADER_MIDDLEWARES = {
    'aroay_cloudscraper.downloadermiddlewares.CloudScraperMiddleware': 543,
}

需setting设置

# 默认日志级别
AROAY_CLOUDSCRAPER_LOGGING_LEVEL = logging.DEBUG

默认超时
AROAY_CLOUDSCRAPER_DOWNLOAD_TIMEOUT = 30

# 默认延迟
AROAY_CLOUDSCRAPER_DELAY = 1

#必须设置,否则报错
COMPRESSION_ENABLED = False

RETRY_ENABLED: True
RETRY_TIMES: 3

代理使用

    def start_requests(self):
        for page in range(1, 2):
            yield CloudScraperRequest(self.base_url, callback=self.parse_index, dont_filter=True, proxy={
                "http": "http://username:password@ip:port",
                "https": "http://username:password@ip:port",
            },cookies={"over18":"1"},timeout=5)

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

aroay_cloudscraper-1.3.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

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

aroay_cloudscraper-1.3-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file aroay_cloudscraper-1.3.tar.gz.

File metadata

  • Download URL: aroay_cloudscraper-1.3.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

File hashes

Hashes for aroay_cloudscraper-1.3.tar.gz
Algorithm Hash digest
SHA256 557ab9db032166a67509dc5b1f9e6bb58ecdc2fb776799380d4a6cc6242062da
MD5 1dfbb94deefa17880f96fb7fe8d8689c
BLAKE2b-256 67b63aab53ec8da7ee37635f94d2434e005f1e50b7f005c5b255b035c68c0fdf

See more details on using hashes here.

File details

Details for the file aroay_cloudscraper-1.3-py3-none-any.whl.

File metadata

  • Download URL: aroay_cloudscraper-1.3-py3-none-any.whl
  • Upload date:
  • Size: 5.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

File hashes

Hashes for aroay_cloudscraper-1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 622e4e8b4837f08b59da4b39bf8bdf127f5745c24908ce6b194b0ef07f65f9bd
MD5 8508c6f78f9153532c2361a82d4d37a8
BLAKE2b-256 49d1dcbd56a72c24194ded2499ee397a644fc7479e76baa234bedab09e9c809a

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