title: Get the node type based on text
body: <p>I have an HTML structure in which I want to find the tag type based on the text i.e. a tag containing a string like "Course Contents." I have the following HTML structure: </p>
  
  <pre><code>&lt;tr&gt;
      &lt;td colspan="2"&gt;
          &lt;h3&gt;
              Course Contents
          &lt;/h3&gt;
      &lt;/td&gt;
  &lt;/tr&gt;
  </code></pre>
  
  <p>and here is my code:</p>
  
  <pre><code>HtmlNode ContentNode = CourseDoc.DocumentNode.Descendants().Where((n =&gt; n.InnerText.Trim().ToLower() == "course contents")).FirstOrDefault();
  </code></pre>
  
  <p>So, how can I get the <code>h3</code> tag that contains the string?</p>
  
  <p>and in addition I want to find the similar h3 tag below this HTML. Here is an example:</p>
  
  <pre><code> &lt;tr&gt;
          &lt;td colspan="2"&gt;
              &lt;h3&gt;
                  Course Contents
              &lt;/h3&gt;
          &lt;/td&gt;
         &lt;td&gt;
           abc
         &lt;/td&gt;
      &lt;/tr&gt;
   &lt;tr&gt;
          &lt;td colspan="2"&gt;
              &lt;h3&gt;
                  Course Outline
              &lt;/h3&gt;
          &lt;/td&gt;
      &lt;/tr&gt;
  </code></pre>
  
  <p>When I found the 1st h3 tag, then through code find the 2nd h3 tag, and retrieve the HTML in between these tags.</p>