HTML converter tool
Project description
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
html_converter-1.0.0.tar.gz
(4.0 kB
view hashes)
Built Distribution
Close
Hashes for html_converter-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6be07515b1281ac006f499bf397bd04454c39053d46ced2edcf2bd5ed2f22fdf |
|
MD5 | 3e38c959ea698efed9e8f423b3142072 |
|
BLAKE2b-256 | d06452cfaff6161765d0583ca3919d00203143275c1d5807c23cdfd445487ab5 |