title: HtmlAgility check if subclass with specific name exists
body: <pre><code>&lt;li class="sn-g"&gt;
       &lt;span class="num"&gt;1&lt;/span&gt;
       &lt;span class="sym_first"&gt;
            &lt;a class="icon&gt;&amp;nbsp;&lt;/a&gt;
       &lt;/span&gt;
       &lt;span class="def"&gt;...text&lt;/span&gt;
  &lt;/li&gt;
  </code></pre>
  
  <p>My HTML page contains such sub classes. However, the <code>sym_first</code> class is not present always. Using HTMLAgility I want to find whether <code>sym_first</code> class exists in the webpage. If it exists I want to get the InnerText from <code>def</code> class. </p>
  
  <pre><code>foreach (HtmlNode node in doc.DocumentNode.SelectNodes("//span[@class='" + sng + "']"))
  {
     //How do I write this block?
     if(doc.DocumentNode.SelectNodes("//span[@class='" + symfirst + "']").Contains(xxx)
     {
        //get inner text
     }
  } 
  </code></pre>