Repository Details
Shared by
HelloGitHub Rating
0 ratings
基于 asyncio 和 aiohttp 的 Python3 异步爬虫框架
Past 7 days Received -1 stars ✨
Use arrow keys to explore dates, Home and End for the first and last date, Escape to dismiss.| Date | Star | Daily change |
|---|---|---|
| 周三 | 1,738 | — |
| 周四 | 1,738 | 0 |
| 周五 | 1,738 | 0 |
| 周六 | 1,738 | 0 |
| 周日 | 1,738 | 0 |
| 周一 | 1,737 | -1 |
| 周二 | 1,737 | 0 |
1.7k
Stars
No
Chinese
Python
Language
Yes
Active
17
Contributors
9
Issues
No
Organization
None
Latest
187
Forks
Apache-2.0
License

基于 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