项目详情
由
分享


HelloGitHub 评分
0 人评分
开源•Apache-2.0
认领
讨论
收藏
分享
1.8k
星数
否
中文
Python
主语言
否
活跃
13
贡献者
9
Issues
否
组织
0.8.0
最新版本
184
Forks
Apache-2.0
协议
更多

基于 asyncio 和 aiohttp 的 Python3 异步爬虫框架。它具有容易上手、非阻塞、扩展性强等特点,实例代码:
```python
from ruia import TextField, Item, Spider
class HackerNewsItem(Item):
target_item = TextField(css_select='tr.athing')
title = TextField(css_select='a.storylink')
class HackerNewsSpider(Spider):
start_urls = ['https://news.ycombinator.com/news?p=1']
async def parse(self, response):
async for item in HackerNewsItem.get_items(html=response.html):
yield item
if __name__ == '__main__':
HackerNewsSpider.start()
```
收录于:
第 35 期
评论
评分:
暂无精选评论