Giter Site home page Giter Site logo

dimtown-spider's Introduction

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 ->一款同步异步兼容的网络请求库

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.