HTML Converter Tool
Support Html to Dict, JSON, Str
Installing
Install and update using pip3:
$ pip3 install html_converter
Python 3 and newer.
Simple Usage
if __name__ == '__main__':
import pprint
from html_converter import HtmlToDict
html_data = '<html><body>test text</body></html>'
converter = HtmlToDict()
data = converter.convert(html_data, serialize=False)
pp = pprint.PrettyPrinter(indent=1)
pp.pprint(converter.convert(html_data, serialize=False).to_dict())
[{'attrs': {},
'inner': [{'attrs': {}, 'inner': [], 'tag': 'body', 'text': 'test text'}],
'tag': 'html',
'text': ''}]
print(converter.convert(html_data, serialize=False).to_json())
'[{"tag": "html", "attrs": {}, "text": "", "inner": [{"tag": "body", "attrs": {}, "text": "fd", "inner": []}]}]'
print(converter.convert(html_data).to_str())
test text
Support
Python 3.x
Supports all operating systems
Links
License: MIT License
Release files for html-converter 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| html_converter-1.0.0.tar.gz | 4.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| html_converter-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.3 kB
Release files / html_converter-1.0.0.tar.gz
| Download URL | html_converter-1.0.0.tar.gz |
|---|---|
| Size | 4.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b16ccfa9cc92d9e78920fd043db0f49737e4e78be0a2eaad106fd69067d4beb3
|
|
BLAKE2b-256 checksum How to use checksums |
638e874e14657045710a11ad0e6cf748ab1ec7968832c0bc623b9a49970bafe7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.10
|
Release files / html_converter-1.0.0-py3-none-any.whl
| Download URL | html_converter-1.0.0-py3-none-any.whl |
|---|---|
| Size | 4.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6be07515b1281ac006f499bf397bd04454c39053d46ced2edcf2bd5ed2f22fdf
|
|
BLAKE2b-256 checksum How to use checksums |
d06452cfaff6161765d0583ca3919d00203143275c1d5807c23cdfd445487ab5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.10
|