title: Parsing Form action and input name and values using html agility pack
body: <p>I'm trying to parse the form action value and input name with value from the following HTML code:</p>
  
  <pre><code>            &lt;form method="post" action="actionURL" autocomplete="" name="login_form" id="login_form" onsubmit="return hash2(this)"&gt;
  
              &lt;input type="hidden" name=".tries" value="1"&gt;
              &lt;input type="hidden" name=".src" value="ym"&gt;
              &lt;input type="hidden" name=".md5" value=""&gt;
              &lt;input type="hidden" name=".hash" value=""&gt;
              &lt;input type="hidden" name=".js" value=""&gt;
              &lt;input type="hidden" name=".last" value=""&gt;
              &lt;input type="hidden" name="promo" value=""&gt;
              &lt;input type="hidden" name=".intl" value="us"&gt;
              &lt;input type="hidden" name=".lang" value="en"&gt;
              &lt;input type="hidden" name=".bypass" value=""&gt;
              &lt;input type="hidden" name=".partner" value=""&gt;
              &lt;input type="hidden" name=".u" value="8013sg1858dp9"&gt;
              &lt;input type="hidden" name=".v" value="0"&gt;
              &lt;input type="hidden" name=".challenge" value="fUhehaaMq9c2lQjndCps_rNu1eSB"&gt;
              &lt;input type="hidden" name=".yplus" value=""&gt;
              &lt;input type="hidden" name=".emailCode" value=""&gt;
              &lt;input type="hidden" name="pkg" value=""&gt;
              &lt;input type="hidden" name="stepid" value=""&gt;
              &lt;input type="hidden" name=".ev" value=""&gt;
              &lt;input type="hidden" name="hasMsgr" value="0"&gt;
              &lt;input type="hidden" name=".chkP" value="Y"&gt;
              &lt;input type="hidden" name=".done" value="somevalue"&gt;
              &lt;input type="hidden" name=".pd" value="ym_ver=0&amp;c=&amp;ivt=&amp;sg="&gt;
              &lt;input type="hidden" name=".ws" id=".ws" value="0"&gt;
              &lt;input type="hidden" name=".cp" id=".cp" value="0"&gt;     
              &lt;input type="hidden" name="nr" value="0"&gt;
  
              &lt;input type="hidden" name="pad" id="pad" value="5"&gt;
              &lt;input type="hidden" name="aad" id="aad" value="5"&gt;
  
                              &lt;div id='inputs'&gt;
  
                  &lt;label for='username'&gt;Yahoo! ID&lt;/label&gt;
                                      &lt;input name='login' id='username' maxlength='96' tabindex='1' value=''&gt;
  
                      &lt;p id='ex'&gt;(e.g. test)&lt;/p&gt;
  
                  &lt;label for='passwd'&gt;Password&lt;/label&gt;
                  &lt;input name='passwd' id='passwd' type='password' maxlength='64' tabindex='2'&gt;
  
  
      &lt;div id="captchaDiv"&gt;&lt;/div&gt;
              &lt;/div&gt;
  &lt;div id='fun'&gt;&lt;/div&gt;
  
          &lt;div id='persistency'&gt;
              &lt;input type='checkbox' name='.persistent' id='persistent' tabindex='4' value='y' &gt;
              &lt;p&gt;
                &lt;label for='persistent'&gt;Keep me signed in&lt;/label&gt;
                &lt;br&gt;
                &lt;span id='uncheck'&gt;(Uncheck if on a shared computer)&lt;/span&gt;
              &lt;/p&gt;
          &lt;/div&gt;
  
  
      &lt;div id='submit'&gt;
          &lt;button type='submit' id='.save' name='.save' class='secondaryCta' tabindex='5'&gt;
            Sign In
          &lt;/button&gt;           &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>The above form contains, input type in direct children and beside children of children. While using sample here: <a href="https://stackoverflow.com/a/9890022/1007447">https://stackoverflow.com/a/9890022/1007447</a> code trace on c# finds no elements or Descendants for name "form". </p>
  
  <p>How to get the form action and all input types with value? (sometimes, I need to skip the username password part too)</p>