title: Extract data from a HTML table and convert to JSON
body: <p>I have a HTML table that I want to parse and convert to JSON.</p>
  
  <pre><code>&lt;table cellspacing="0" style="height: 24px;"&gt;
   &lt;tr class="tr-hover"&gt;
    &lt;th rowspan="15" scope="row"&gt;Network&lt;/th&gt;
    &lt;td class="ttl"&gt;&lt;a href="network-bands.php3"&gt;Technology&lt;/a&gt;&lt;/td&gt;
    &lt;td class="nfo"&gt;&lt;a href="#" class="link-network-detail collapse"&gt;GSM&lt;/a&gt;&lt;/td&gt;
   &lt;/tr&gt;
   &lt;tr class="tr-toggle"&gt;
    &lt;td class="ttl"&gt;&lt;a href="network-bands.php3"&gt;2G bands&lt;/a&gt;&lt;/td&gt;
    &lt;td class="nfo"&gt;GSM 900 / 1800 - SIM 1 &amp; SIM 2&lt;/td&gt;
   &lt;/tr&gt;  
   &lt;tr class="tr-toggle"&gt;
    &lt;td class="ttl"&gt;&lt;a href="glossary.php3?term=gprs"&gt;GPRS&lt;/a&gt;&lt;/td&gt;
    &lt;td class="nfo"&gt;Class 12&lt;/td&gt;
   &lt;/tr&gt;  
   &lt;tr class="tr-toggle"&gt;
    &lt;td class="ttl"&gt;&lt;a href="glossary.php3?term=edge"&gt;EDGE&lt;/a&gt;&lt;/td&gt;
    &lt;td class="nfo"&gt;Yes&lt;/td&gt;
   &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>In the above table </p>
  
  <pre><code>&lt;th rowspan="15" scope="row"&gt;Network&lt;/th&gt; 
  </code></pre>
  
  <p>JSON array name should be "Network". </p>
  
  <pre><code>&lt;td class="ttl"&gt;&lt;a href="network-bands.php3"&gt;Technology&lt;/a&gt;&lt;/td&gt;
  </code></pre>
  
  <p>Technology is a subheading of Network, so it must be a JSON element inside the JSON array. The values coming inside Technology array should be the values from </p>
  
  <pre><code>&lt;td class="nfo"&gt;&lt;a href="#" class="link-network-detail collapse"&gt;GSM&lt;/a&gt;&lt;/td&gt;
  </code></pre>
  
  <p>I hope my question is clear. How can i do that?</p>