Skip to main content

A spider for https://dimtown.com

Project description

Logo

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 hashes)

Uploaded Source

Built Distribution

dimtown_spider-0.1.1-py3-none-any.whl (8.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page