title: Is it possible to convert HTML to JSON exactly as this website (toolslick) but using Python?
body: <p>I have this HTML and I went to toolslick.com to convert it to JSON. So, I got this JSON and I would like to know if is it possible to do exactly as it is, but in Python. What could I use? Regex? Some library? A loop? I tried some things but unsuccessfully. It doesn't need to be in JSON but I thought it was the best since I can acess the values using ['tr'][0] for example. Thank you.</p>
  
  <pre><code>HTML:
  &lt;tr&gt;
      &lt;td&gt;
          &lt;span class="theme1"&gt;1&lt;/span&gt; Charisma
      &lt;/td&gt;
      &lt;td&gt;
          &lt;span class="theme1"&gt;1&lt;/span&gt; Smartness
      &lt;/td&gt;
      &lt;td&gt;
          &lt;span class="theme1"&gt;1&lt;/span&gt; Health
      &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
      &lt;td&gt;&lt;/td&gt;
      &lt;td&gt;&lt;/td&gt;
      &lt;td&gt;Age: 
          &lt;span class="green"&gt;20&lt;/span&gt;
      &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
      &lt;td colspan="3" class="active"&gt;Strength: 
          &lt;span class="tooltip" data-tip="Lorem ipsum dolor sit amet, consectetur"&gt;
              &lt;icon&gt;i-hand&lt;/icon&gt; Hand
          &lt;/span&gt;
      &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
      &lt;td colspan="3" class="inactive"&gt;Weakness: 
          &lt;span class="tooltip" data-tip="Donec egestas lectus quis"&gt;
              &lt;icon&gt;i-feet&lt;/icon&gt; Feet
          &lt;/span&gt;
      &lt;/td&gt;
  &lt;/tr&gt;
  
  JSON:
  {
    "tr": [
      {
        "td": [
          {
            "span": {
              "@class": "theme1",
              "#text": "1"
            },
            "#text": "Charisma"
          },
          {
            "span": {
              "@class": "theme1",
              "#text": "1"
            },
            "#text": "Smartness"
          },
          {
            "span": {
              "@class": "theme1",
              "#text": "1"
            },
            "#text": "Health"
          }
        ]
      },
      {
        "td": [
          "",
          "",
          {
            "span": {
              "@class": "green",
              "#text": "20"
            },
            "#text": "Age:"
          }
        ]
      },
      {
        "td": {
          "@colspan": "3",
          "@class": "active",
          "span": {
            "@class": "tooltip",
            "@data-tip": "Lorem ipsum dolor sit amet, consectetur",
            "icon": "i-hand",
            "#text": "Hand"
          },
          "#text": "Strength:"
        }
      },
      {
        "td": {
          "@colspan": "3",
          "@class": "inactive",
          "span": {
            "@class": "tooltip",
            "@data-tip": "Donec egestas lectus quis",
            "icon": "i-feet",
            "#text": "Feet"
          },
          "#text": "Weakness:"
        }
      }
    ]
  }
  </code></pre>