C# Html Agility Pack parsing tags with multiple alternatives
<p>I don't have any experience with HTML, so excuse any incorrect terminology.</p>

<p>I am trying to parse an HTML document using the HTML Agility Pack, and I am looking for a very specific string.</p>

<p>I want to obtain all strings of the form:</p>

<pre class="lang-html prettyprint-override"><code>&lt;img src="..." etc=...."&gt;
</code></pre>

<p>So my select parameter is </p>

<pre class="lang-cs prettyprint-override"><code>HtmlNodeCollection images = doc.DocumentNode.SelectNodes("//img[@src]");
</code></pre>

<p>However, this also ends up returning strings such as</p>

<pre class="lang-html prettyprint-override"><code>&lt;img width="..." src="..." etc=".."&gt;
</code></pre>

<p>It seems to me (at least to the best of my knowledge): The img tag is searched for and src only needs to be found on the same level, not necessarily right next to the img tag.</p>

<p>After looking at the documentation I feel that I am trying to do something I am not allowed to with this function. </p>

<p>Can someone please suggest the correct way to do this. Thanks!</p>