A small example package
Project description
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)
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
html2obj-genwch-0.0.4.tar.gz
(8.4 kB
view details)
Built Distribution
File details
Details for the file html2obj-genwch-0.0.4.tar.gz
.
File metadata
- Download URL: html2obj-genwch-0.0.4.tar.gz
- Upload date:
- Size: 8.4 kB
- Tags: Source
- Uploaded using 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
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e53a364e9d17ea346741df0f84830444f5c7d3460130d307ea6cfae814996bed |
|
MD5 | b83689eeba27505ea5bfc897a88b461c |
|
BLAKE2b-256 | 9315eba5896e863a72ff68c50cca803739d97d9c7a3ad050ed544485b460dd62 |
Provenance
File details
Details for the file html2obj_genwch-0.0.4-py3-none-any.whl
.
File metadata
- Download URL: html2obj_genwch-0.0.4-py3-none-any.whl
- Upload date:
- Size: 9.2 kB
- Tags: Python 3
- Uploaded using 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
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 26daa0e93ea0a4d6dae243df7a2379309f7caffd14167e9c07cfe1b97a63550e |
|
MD5 | c4ebf5ad55958c182d607b26221f03ba |
|
BLAKE2b-256 | 3fff5d076313a7a7d1bf8b50786bb3a4295b6835e16f96fe5ebaf500a399cd1a |