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.5.tar.gz
(8.4 kB
view hashes)
Built Distribution
Close
Hashes for html2obj_genwch-0.0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1ef7dda28a0dd16348289a88a661c017c9fa82462fae4d516710bc5450cf6e88 |
|
MD5 | 049095f3a8121f4874c8c3e03d752ba1 |
|
BLAKE2b-256 | 77656d4eb12bd20aeb0254ca407cd7c31cfea9da600ae29ab95bffa983b34816 |