title: Getting attribute value using Selenium
body: <p>This is my html page i want to parse:</p>
  <pre><code>&lt;html lang=&quot;en-US&quot; data-ismobile=&quot;false&quot;&gt;
      &lt;body ond=&quot;return false;&quot; onselect=&quot;return false;&quot; textmenu=&quot;return false&quot;&gt;
          &lt;div id=&quot;wrap&quot;&gt;
              &lt;form id=&quot;frm1&quot; method=&quot;post&quot;&gt;
                  &lt;input name=&quot;Token&quot; type=&quot;hidden&quot; value=&quot;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&quot;&gt;
                  &lt;input type=&quot;hidden&quot; name=&quot;cate&quot; value=&quot;0&quot;&gt;
                  &lt;input type=&quot;hidden&quot; name=&quot;sub&quot; value=&quot;7&quot;&gt;
              &lt;/form&gt;
              &lt;form id=&quot;frm2&quot; method=&quot;post&quot;&gt;
                  &lt;input name=&quot;Token&quot; type=&quot;hidden&quot; value=&quot;YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY&quot;&gt;
                  &lt;input type=&quot;hidden&quot; name=&quot;cate&quot; value=&quot;0&quot;&gt;
                  &lt;input type=&quot;hidden&quot; name=&quot;sub&quot; value=&quot;7&quot;&gt;
              &lt;/form&gt;
          &lt;/div&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  <p>I am trying to get <code>name</code> &amp; <code>value</code>  attributes from form <code>frm1</code></p>
  <p>So far i have come up with following code:</p>
  <pre><code>IWebElement _frm1 = webDriver.FindElement(By.Id(&quot;frm1&quot;)); //this should find me a correct form
  token_frm1 = _frm1 .GetAttribute(&quot;value&quot;); //this i know is inccorect 
  </code></pre>