A spider for https://dimtown.com
Project description
dimtown-spider
⭐基于httpx
的为次元小镇的异步爬虫⭐
⭐ 介绍
- 本项目采用
Apache License 2.0
开源协议。在使用这个项目之前,请确保你已经仔细阅读并理解了协议的相关条款。本项目严禁用于任何商业用途,并且只能用于学习和研究。如果在使用本项目的过程中产生任何问题或结果,我们不承担任何责任。同时,我们鼓励用户为这个项目的改进和发展提供反馈和建议。
🦈 安装
安装
pip 安装
pip install dimtown-spider -U
poetry 安装
poetry add dimtown-spider
🐟 使用
可见以下示例:
# 测试程序
from dimtown import Search, ReturnImage
import asyncio
sc = Search("原神")
loop = asyncio.get_event_loop()
list_ = loop.run_until_complete(sc.get_img_list())
img_list = loop.run_until_complete(sc.get_img_url(list_[0]))
async def show_image(img_list: ReturnImage):
for img in img_list:
print(img)
# 异步迭代器,显示图片
async for img in img_list:
img.show()
await asyncio.sleep(1)
loop.run_until_complete(show_image(img_list))
🐖 注意事项
- 别爬太多
- 适度使用
- 健康生活
鸣谢
httpx ->一款同步异步兼容的网络请求库
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
dimtown_spider-0.1.1.tar.gz
(8.1 kB
view details)
Built Distribution
File details
Details for the file dimtown_spider-0.1.1.tar.gz
.
File metadata
- Download URL: dimtown_spider-0.1.1.tar.gz
- Upload date:
- Size: 8.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1f43ab2363fd2c2f67b2f34a3accce971692b905acd63e70d3f5010e90669e3f |
|
MD5 | 1b5288f1c97e0ede8614f4dd764f1243 |
|
BLAKE2b-256 | bdfec56125a76a9cc185f37a9476b046a17e2dc125df78393b0fdc44b1089f22 |
File details
Details for the file dimtown_spider-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: dimtown_spider-0.1.1-py3-none-any.whl
- Upload date:
- Size: 8.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2c9add8d724b7007bd98a818a2aa92143accc652d9e21a209adaeb5eef54ba80 |
|
MD5 | 4e353dd7cdd0a63ca66fd02f1c92ff37 |
|
BLAKE2b-256 | 09318d10746c760546e46b2869b0e5931c6c7761bca261e752410410226b6a43 |