Skip to main content

Lightweight and expandable spider framework.

Project description

charlotte

Build Status

Lightweight and expandable spider framework.

Install

pip install charlotte

Example

import json
import asyncio
from charlotte.spider import BaseSpider


class Spider(BaseSpider):

    async def on_start(self):
        response = await self.fetch('https://blog.qiaohong.org/api/v1/articles')

        items = json.loads(response.body)

        await asyncio.wait(
            [self.fetch('https://blog.qiaohong.org/api/v1/articles/' + item['slug'],
                        parser=self.parse_detail) for item in items['data']['articles']])

    def parse_detail(self, res):
        print(res.body.decode('utf-8'))


if __name__ == '__main__':
    Spider().run()

Documentation

Check wiki for details.

LICENSE

MIT

Project details


Download files

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

Files for charlotte, version 0.2.4
Filename, size File type Python version Upload date Hashes
Filename, size charlotte-0.2.4.tar.gz (5.2 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page