easy-spider-tool 可选xpath/jsonpath聚合解析扩展包
Project description
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=''))
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.10.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1189389dbde4392914c66e11e003255f9d8b36a75f33f4fe01956f068c01d702 |
|
MD5 | 29d9b37026b1c28a6e226685984a8005 |
|
BLAKE2b-256 | 8cb9fa22ed786c3b802d8b783209e69b424df49e6fcedbcebeb87b368336dacf |
Close
Hashes for easy_spider_tool_document-1.0.10-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8306b2baf1fe6f08a127764a75f2455ec011515aa90981a9c2aeba0091378389 |
|
MD5 | 8b658b385d7ae79d33a27ca825776877 |
|
BLAKE2b-256 | 17c5dfc534d172081a7471c544b04db56e19837a42478e96229cb9c3e624e6fb |