Skip to main content

A simple async Python module to bypass Cloudflare's anti-bot page. See https://github.com/pavlodvornikov/aiocfscrape for more information.

Project description

A simple async Python module to bypass Cloudflare's anti-bot page. Based on aiohttp ClientSession. Solution was inherited from cfscrape module.

You could use it eg. with Python 3 and asyncio for concurrent crawling of web resources protected with CloudFlare.

Installation

Install with pip

pip install aiocfscrape

Basic Usage

aiocfscrape is a aiohttp.ClientSession wrapper. So aiohttp client reference can be used as the base.

To make simple get request do the following:

import asyncio
from aiocfscrape import CloudflareScraper

async def test_open_page(url):
    async with CloudflareScraper() as session:
        async with session.get(url) as resp:
            return await resp.text()

if __name__ == '__main__':
    asyncio.run(test_open_page('<your url>'))

Dependencies

License

aiocfscrape is offered under the MIT license.

Changelog

1.0.0 (2020-03-25)

0.0.9 (2019-03-21)

  • Update anit-bot integration to latest cfscrape version [gaardiolor]

0.0.8 (2019-03-16)

  • Update anit-bot integration to latest cfscrape version [gaardiolor]

0.0.7 (2019-01-10)

  • Fix error when host does not return a “Server” header [pavlodvornikov]

  • Update anit-bot integration to latest cfscrape version [gaardiolor]

0.0.6 (2018-06-19)

  • Update readme [pavlodvornikov]

0.0.5 (2018-06-19)

  • Fix aiohttp version 3 compatibility [ape364]

  • Bump js2py [ape364]

  • Update anti-bot integration to latest cfscrape version [dteh]

0.0.4 (2018-03-06)

  • Update anti-bot integration to latest cfscrape version [slazarov]

0.0.3 (2017-11-21)

  • Fix AttributError [ape364]

0.0.2 (2016-08-26)

  • Support timeout inside request [pavlodvornikov]

  • Update package information [pavlodvornikov]

  • Remove obsolete files [pavlodvornikov]

0.0.1 (2016-08-26)

  • Initial implementation

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

aiocfscrape-1.0.0.tar.gz (6.9 kB view details)

Uploaded Source

File details

Details for the file aiocfscrape-1.0.0.tar.gz.

File metadata

  • Download URL: aiocfscrape-1.0.0.tar.gz
  • Upload date:
  • Size: 6.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.7.2

File hashes

Hashes for aiocfscrape-1.0.0.tar.gz
Algorithm Hash digest
SHA256 3fc3dd05f802a8ac61001ac418cf7a248548eeabc730b2f01afad8de99c10dd1
MD5 3d70c26f39c33e1e2ec2d12133d2fea6
BLAKE2b-256 0c0ce39bb13e99fdbf296196c4ac59cf523b876e4a0bca0bfd75a3583a822096

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