charlotte-0.2.4
توضیحات
Lightweight and expandable spider framework.
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | charlotte-0.2.4 |
| نام | charlotte |
| نسخه کتابخانه | 0.2.4 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Jack King |
| ایمیل نویسنده | email@qiaohong.org |
| آدرس صفحه اصلی | https://github.com/Jack-Kingdom/charlotte |
| آدرس اینترنتی | https://pypi.org/project/charlotte/ |
| مجوز | MIT |
# charlotte
[](https://travis-ci.com/Jack-Kingdom/charlotte)
Lightweight and expandable spider framework.
## Install
```shell
pip install charlotte
```
## Example
```python
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](https://github.com/Jack-Kingdom/charlotte/wiki) for details.
## LICENSE
MIT
نحوه نصب
نصب پکیج whl charlotte-0.2.4:
pip install charlotte-0.2.4.whl
نصب پکیج tar.gz charlotte-0.2.4:
pip install charlotte-0.2.4.tar.gz