Skip to main content

Crawler

https://travis-ci.org/lorien/crawler.png?branch=master https://coveralls.io/repos/lorien/crawler/badge.svg?branch=master https://pypip.in/download/crawler/badge.svg?period=month https://pypip.in/version/crawler/badge.svg https://landscape.io/github/lorien/crawler/master/landscape.png

Web scraping framework based on py3 asyncio & aiohttp libraries.

Usage Example

import re
from itertools import islice

from crawler import Crawler, Request

RE_TITLE = re.compile(r'<title>([^<]+)</title>', re.S | re.I)

class TestCrawler(Crawler):
    def task_generator(self):
        for host in islice(open('var/domains.txt'), 100):
            host = host.strip()
            if host:
                yield Request('http://%s/' % host, tag='page')

    def handler_page(self, req, res):
        print('Result of request to {}'.format(req.url))
        try:
            title = RE_TITLE.search(res.body).group(1)
        except AttributeError:
            title = 'N/A'
        print('Title: {}'.format(title))

bot = TestCrawler(concurrency=10)
bot.run()

Installation

pip install crawler

Dependencies

  • Python>=3.4

  • aiohttp

Metadata

Release files for crawler 0.0.2

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

Source distribution (sdist)

Source distribution for crawler 0.0.2
File Size Uploaded
crawler-0.0.2.tar.gz 6.0 kB Details

Release files / crawler-0.0.2.tar.gz

Download URL crawler-0.0.2.tar.gz
Size 6.0 kB
Tags Source
SHA-256 checksum
How to use checksums
b6b5bcc2f2a64ac60251bee1494bd7ea98605ef1a8bf87db5194bea4bdd420d2
BLAKE2b-256 checksum
How to use checksums
8d422b042beebf63f6d490d38b698f06ee4fdd16a1d32fa2373a6b662a37a33d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.0.2 This release

1 release file

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