Skip to main content

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)

Source distribution for html2obj-genwch 0.0.8
File Size Uploaded
html2obj-genwch-0.0.8.tar.gz 8.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for html2obj-genwch 0.0.8
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

This release

0.0.8 This release

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page