easy-spider-tool 可选xpath/jsonpath聚合解析扩展包
Project description
simple-spider-tool-document
简易,好用的easy-spider-tool 兼容并可选的document解析扩展包
安装
pip install pip install simple-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=''))
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=''))
链接
Github:https://github.com/hanxinkong/easy-spider-tool-document
在线文档:https://easy-spider-tool-document.xink.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
Built Distribution
Close
Hashes for easy-spider-tool-document-1.0.8.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | e863d99c35771b86c95904c7f154b74d70838543751b43ca00dd2233107da8dc |
|
MD5 | aa17182dc5d4639488070a68e564adee |
|
BLAKE2b-256 | 7900565f9708493a1426294a7f32dbbe105dde9601f12440ec6a1fb3e927ea52 |
Close
Hashes for easy_spider_tool_document-1.0.8-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c13d76161e3a3a7c502e028c9a856f5bc42091f2c08a5ac0154a34b4e52eee20 |
|
MD5 | ad2dd82073d6c5218b3890deb1913789 |
|
BLAKE2b-256 | 4b20a33ed6bb3da92c7cdf108053ac3fd36dcf8c927493b8bb3fb7454f8c5f80 |