Given the following html:
<ul id="search-results">
<li>
<h3>Result 1</h3>
<span class="some-info">Tag line</span>
</li>
<li>
<h3>Result 2</h3>
<span class="some-info">Another bit</span>
</li>
<li>
<h3>Result 2</h3>
<span class="some-info">Another bit</span>
</li>
</ul>
I can get the ul
element with:
Element ul = ie.Element(Find.ById("search-results"));
How do I iterate over the children of the search-results
?
I've managed to get as far as:
var allListItems = ie.Elements.Filter(e => e.Parent != null && e.Parent.Id == "search-results");
But this doesn't help me assert things about the H3 or span contained within the li
's.