No project description provided
Project description
根据规则解析 JSON 数据,返回对应内容数据
from grab.base_scary import BaseScary
scary = BaseScary("http://httpbin.org/ip",[{"tag": 'IP',"rule": "origin","rules": []}])
rules = [
{"tag": 'IP', "rule": "origin", "rules": []},
]
scary = BaseScary("https://httpbin.org/ip", rules)
result, err = scary.active()
if err:
print(err)
else:
print(result)
根据规则解析 HTML 数据,返回对应内容数据
from grab.base_scary import BaseScary
rules = [
{"tag": 'links',
"rule": "//div[contains(@class,'nav-mod-1')]/ul/li/a", "rules": [
{"tag": "text", "rule": "text()","rules": []},
{"tag": "url", "rule": "@href","rules": []}
]}
]
scary = BaseScary(
"https://www.sina.com.cn/", rules)
result, err = scary.active()
if err:
print(err)
else:
print(result)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
WebGrab-0.1-py3-none-any.whl
(18.6 kB
view details)
File details
Details for the file WebGrab-0.1-py3-none-any.whl.
File metadata
- Download URL: WebGrab-0.1-py3-none-any.whl
- Upload date:
- Size: 18.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7320d12fb5ebc5370bdbed2ac34c4589020ceb16bf75c2d7e4a469f196f2fbf6
|
|
| MD5 |
b0f8e5b0af1a0848e660319eb8e90d9d
|
|
| BLAKE2b-256 |
3657d22b754cd55402c35d4f49845c059f387b8adbfa447fed596a8e39655013
|