Skip to main content

A simple HTML to Tree Diagram library that outputs HTML DOM as image for visualization.

Project description

html-dom-visualize

A simple HTML to Tree Diagram library that outputs HTML DOM as image for visualization. Supports custom elements filtering and masking.

Useful when analyzing elements composition of HTML documents or developing tools that manipulates HTML DOM structures.

Install

pip install html-dom-visualize

Using in Command line

options:
  -h, --help            show this help message and exit
  -f FILE, --file FILE  Path to local HTML file to analyze
  -u URL, --url URL     URL of the HTML page to analyze
  -b BRANCH, --branch BRANCH
                        Element tags that if included, their
                        ancestors and all their descendants
                        would be preserved. Multiple tags can
                        be specified If not specified, all
                        elements will be preserved.
  -m MASK, --mask MASK  Element tags that if included, they
                        will be masked from the output graph
                        such that their children will be
                        removed, and only the inner texts will
                        be preserved. Multiple tags can be
                        specified. If not specified, no tags
                        will be masked.

example:
# only include branches that contains <button> / <input>
# mask out children inside <button> and <a>
html-dom-visualize -f ./webpage.html -b button -b input -m a -m b 

# load from URL
html-dom-visualize -u https://google.com

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

html_dom_visualize-0.1.2.tar.gz (4.5 kB view hashes)

Uploaded Source

Built Distribution

html_dom_visualize-0.1.2-py3-none-any.whl (5.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page