Skip to main content

simple-spider-tool-document

easy-spider-tool 可选xpath/jsonpath聚合解析扩展包

安装

pip install easy-spider-tool[document]

主要功能

  • data_extractor 表达式数据解析(支持jsonpath,xpath)
  • xpath xpath语法解析数据(支持首选项,设置默认值)

简单使用

from easy_spider_tool_document import data_extractor

data = '<p>这是一个easy_spider_tool的document扩展的示例</p>'
print(data_extractor(data, ['//p//text()'], first=True, default=''))
# 这是一个easy_spider_tool的document扩展的示例

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

print(data_extractor(data, ['$.data[*].username'], first=False, default=''))
# ['admin', 'user']

链接

Github:https://github.com/hanxinkong/easy-spider-tool-document

在线文档:https://easy-spider-tool-document.xink.top/

注明

Metadata

Release files for easy-spider-tool-document 1.0.13

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for easy-spider-tool-document 1.0.13
File Size Uploaded Provenance Actions
easy-spider-tool-document-1.0.13.tar.gz 3.3 kB Without provenance Details for easy-spider-tool-document-1.0.13.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for easy-spider-tool-document 1.0.13
File Interpreter ABI Platform Actions
easy_spider_tool_document-1.0.13-py3-none-any.whl Python 3 none any Details for easy_spider_tool_document-1.0.13-py3-none-any.whl

Total release size: 8.1 kB

Release files / easy-spider-tool-document-1.0.13.tar.gz

Download URL easy-spider-tool-document-1.0.13.tar.gz
Size 3.3 kB
Tags Source
SHA-256 checksum
How to use checksums
882295b48f25639bf3c36919f3ad860164c259dd718187df50c8257c268eb28b
BLAKE2b-256 checksum
How to use checksums
ccc4a5c79e72293655f3c83e5e6921a1699a3f3ebc37a78ce7e559b0160f39d7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.7.6

Release files / easy_spider_tool_document-1.0.13-py3-none-any.whl

Download URL easy_spider_tool_document-1.0.13-py3-none-any.whl
Size 4.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a7f1dabd1d1524cac3a0e98b6a6a16406a3bf34fb410decf9137b1ec9080e051
BLAKE2b-256 checksum
How to use checksums
03e65c3d7aefc0e43a5dbbd12231938a67522e16cbdc43b6b96828a3d853999d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.7.6

Security for easy-spider-tool-document 1.0.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page