7

I want to visualize the document structure of a HTML website.

What I would like to have is something like this:

enter image description here

Are there any known tools that do this and where the results can be saved as a bitmap file?

Benny Neugebauer
  • 46,191
  • 22
  • 218
  • 190
  • 1
    i built a little thing that does exactly this: http://dok.github.io/dom-visualization/ – Sean Mar 11 '16 at 21:51

2 Answers2

7

I use LaTeX to create the DOM representation.

Here is a minimal working example:

\documentclass{scrreprt}
\usepackage{tikz-qtree}
\begin{document}

  \Tree[.table 
         [.thead 
           [.tr 
             [.th [.\textit{Vorname} ] ]
             [.th [.\textit{Nachname} ] ]
           ]
         ]              
         [.tbody 
           [.tr 
             [.td [.\textit{Donald} ] ]
             [.td [.\textit{Duck} ] ]
           ]
         ]
       ]

\end{document}

Which gives:

enter image description here

Benny Neugebauer
  • 46,191
  • 22
  • 218
  • 190
4

I've just tried using two libraries.

First I converted the dom to JSON using Jsonml

var jsonData = JsonML.fromHTMLText(htmlData);

Then used Json Editor or Json Viewer for visualizing it

View Samples in jsFiddle

  1. Using Json Editor
  2. Using Json Viewer

Hope this may help you.

Sen Jacob
  • 3,214
  • 3
  • 33
  • 57
  • 1
    the github raw url don't work. You should change it. See more here http://stackoverflow.com/a/18049842/815507 – Kunukn Dec 15 '14 at 12:32