title: How can I extract a tag's attribute value from an HTML file?
body: <p>I know, don't parse using curl, grep and sed. But I am looking for an easy approach, not a very safe one.</p>
  
  <p>So I get an HTML file with curl, from which I need a value of a certain attribute from a tag. I use grep to get me the line where it says <code>token</code>. This only occurs once.
  This gives me a whole div: </p>
  
  <pre><code>&lt;div class="userlinks"&gt;
    &lt;span class="arrow flleft profilesettings"&gt;settings&lt;/span&gt;
    &lt;form class="logoutform" method="post" action="/logout"&gt;
      &lt;input class="logoutbtn arrow flright" type="submit" value="Log out"&gt;
      &lt;input type="hidden" name="ltoken" value="a5fc8828a42277538f1352cf9ea27a71"&gt;
    &lt;/form&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>How can I get just the value attribute (e.g. "a5fc8828a42277538f1352cf9ea27a71")?</p>