charlotte
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
Release files for charlotte 0.2.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| charlotte-0.2.4.tar.gz | 5.2 kB | Details |
Release files / charlotte-0.2.4.tar.gz
| Download URL | charlotte-0.2.4.tar.gz |
|---|---|
| Size | 5.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
34a9198246374f12a1d03708cb1bdab177577a084855d3bedcc876862c518cb7
|
|
BLAKE2b-256 checksum How to use checksums |
ed0f2e07981f24da2ed7de2979a8f9ffe9c9d6350536cd255cc95dfdb24accc8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3
|