Format HTML to python object
Support xpath
Sample config
ep_conf = {"url": "{{video_url}}",
"root": "{{root}}",
"items": "//div[@class=\"container\"]/div[2]/div/div[@class=\"myui-panel-bg\"]/div/div[2]/div[@id=\"playlist{{st_cde}}\"]/ul/li[*]/a",
# "items": "//div[@class=\"myui-panel-bg\"]/div/div[@class=\"tab-content\"]/div[@id=\"playlist{{st_cde}}\"]/ul/li[*]/a",
"data": {"root": {"fix": "{{root}}"},
"menu_desc": {"fix": "{{menu_desc}}"},
"smenu_desc": {"fix": "{{smenu_desc}}"},
"video_desc": {"fix": "{{video_desc}}"},
"video_img": {"fix": "{{video_img}}"},
"st_cde": {"fix": "{{st_cde}}"},
"st_desc": {"fix": "{{st_desc}}"},
"ep_cde": {"_attr": "href", "_act": [{"split": {"-": 3}}, {"re": ".html$"}, {"check": {"type": "int"}}]},
"ep_url": {"_attr": "href", "_act": [{"pfx": "{{root}}"}]},
"ep_desc": {"get": "_text"}
}}
Execution
import html2obj
ext = html2obj.extract()
obj = ext.extract(conf=ep_conf)
Release files for html2obj-genwch 0.0.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| html2obj-genwch-0.0.8.tar.gz | 8.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| html2obj_genwch-0.0.8-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 17.7 kB
Release files / html2obj-genwch-0.0.8.tar.gz
| Download URL | html2obj-genwch-0.0.8.tar.gz |
|---|---|
| Size | 8.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
30f7a04476fef5b2593a93f1b573eb311c2b0125682265bfe6cade11991222eb
|
|
BLAKE2b-256 checksum How to use checksums |
61281d54cf85c5ea997a6d2f81dd5568601a78623b2ba74255f0d736a533b45e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.5
|
Release files / html2obj_genwch-0.0.8-py3-none-any.whl
| Download URL | html2obj_genwch-0.0.8-py3-none-any.whl |
|---|---|
| Size | 9.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
deff883a99ac6f50e6f827880f2da890679ed5d71b4295d07f828c0c7677a80e
|
|
BLAKE2b-256 checksum How to use checksums |
365bd44612dc23a24189245c3f4324c060eb2c09f5669f1d2d21e7f9f6fb2168
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.5
|