title: Parse text from HTML form inside table cell with Cheerio
body: <p>I have a HTML table that looks like this:</p>
  
  <pre><code>&lt;tr class="row-class" role="row"&gt;
      &lt;td&gt;Text1&lt;/td&gt;
      &lt;td&gt;
          &lt;form method='get' action='http://example.php'&gt; 
  
              &lt;input type='hidden' name='id_num' value='ABCD123'&gt; &lt;!-- &lt; I NEED THIS VALUE --&gt;
  
              &lt;button type='submit' class='btn' title='Check' &gt;&lt;/button&gt; 
          &lt;/form&gt;
      &lt;/td&gt;  
  &lt;/tr&gt;
  </code></pre>
  
  <p><strong>I want to get the value of the hidden input type named <code>id_num</code>.</strong> (In this example the value I want is <em>"ABCD123"</em>).</p>
  
  <p>I tried to parse the code with <a href="https://www.npmjs.com/package/cheerio" rel="nofollow noreferrer">cheerio</a> like this:</p>
  
  <pre><code>var $ = cheerio.load(body);
  $('tr').each(function(i, tr){
      var children = $(this).children();
  
      var x       = children.eq(0);
      var id_num  = children.eq(1);
  
      var row = {
          "x":        x.text().trim(),     //this is correct, value is Text1
          "id_num":   id_num.text().trim() //This is empty, value is "", I want the value "ABCD123"
      };
  });
  </code></pre>
  
  <p>But I only get the first value correct.</p>
  
  <p><strong>How can I get the value from the hidden input element <code>id_num</code>?</strong></p>
  
  <p>Thanks.</p>