Repository Details
Shared by


HelloGitHub Rating
0 ratings
Free•Apache-2.0
Claim
Discuss
Collect
Share
1.8k
Stars
No
Chinese
Python
Language
No
Active
13
Contributors
9
Issues
No
Organization
0.8.0
Latest
184
Forks
Apache-2.0
License
More

基于 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()
```
Included in:
Vol.35
Comments
Rating:
No comments yet