title: extract text from between html tags with specific id using sed or grep
body: <p>What command should I be using to extract the text from within the following html code which sits in a "test.html" file containing : "<code>&lt;span id="imAnID"&gt;extractme&lt;/span&gt;</code>" ?</p>
  
  <p>The file will be larger so I need to point grep or sed to an id and then tell it to extract only the text from the tag having this ID.
  Assuming I run the terminal from the directory where the file resides, I am doing this:</p>
  
  <pre><code>cat test.html | sed -n 's/.*&lt;span id="imAnID"&gt;\(.*\)&lt;\/span&gt;.*/\1/p'
  </code></pre>
  
  <p>What am I doing wrong? I get an empty output...
  Not opposed to using grep for this if it's easier.</p>