Skip to main content

一些简易、好用的爬虫工具,减少代码与文件冗余,提升工作的效率和代码整洁度

Project description

simple spider tool

在实际工作中,沉淀的一些简易、好用的爬虫工具,减少重复代码与文件冗余,希望一样能为使用者带来益处。如果您也想贡献好的代码片段,请将代码以及描述,通过邮箱( xingcys@gmail.com )发送给我。代码格式是遵循自我主观,如存在不足敬请指出!

安装

pip install simple-spider-tool

简单使用

from simple_spider_tool import format_json, jsonpath

data = {
    "code": 200,
    "data": [
        {
            "id": 1,
            "username": "admin",
            "level": "boss"
        },
        {
            "id": 2,
            "username": "user",
            "level": "staff"
        }
    ]
}

boss_name = jsonpath(data, '$.data[?(@.level=="boss")].username', first=True)
all_user_info = jsonpath(data, '$.data[*].username')

print(boss_name)
print(format_json(all_user_info))

兼容使用

0.0.18对包目录发生改变,由simple_spider_tools更改为simple_spider_tool,如有使用过低于0.0.18版本,请通过安装兼容扩展包以达到兼容使用

pip install simple-spider-tool[seventeen]

链接

Github:https://github.com/xingcweb/simple-spider-tool

在线文档:https://simple-spider-tool.xingc.top/

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

simple_spider_tool-0.0.19.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

simple_spider_tool-0.0.19-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

Details for the file simple_spider_tool-0.0.19.tar.gz.

File metadata

  • Download URL: simple_spider_tool-0.0.19.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.8

File hashes

Hashes for simple_spider_tool-0.0.19.tar.gz
Algorithm Hash digest
SHA256 ce11ff6cf137a3f1e8b5f76f64956fded2db1f9217facf5acec69d740d637d59
MD5 39ed7940bb3c5e45326f3ad9336bff6d
BLAKE2b-256 9f7d81e82e64e809d9bed247b110f711a8f56ad97feaf757bde4af82f24fd0bc

See more details on using hashes here.

File details

Details for the file simple_spider_tool-0.0.19-py3-none-any.whl.

File metadata

File hashes

Hashes for simple_spider_tool-0.0.19-py3-none-any.whl
Algorithm Hash digest
SHA256 a1e0dd25ea26c9656a46bcb60b34fe6f71dc6484763b0d745f30ca1ffd1c5f66
MD5 3c81dc6243c53ded8c8bab541e3dfe59
BLAKE2b-256 9ca904c331fa5b70a8b6b1c5453b0ff6c92a85f8749a9ab5e81d67c6c229b98e

See more details on using hashes here.

Supported by

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