Here's my code:
CQ dom = CQ.Create(htmlString);
var items = dom[".blog-accordion li"];
foreach (var li in items)
{
var newTournament = false;
var test = li["header h2"];
}
Inside the foreach loop li
turns into a IDomObject
variable and I can no longer drill down further into it.
Any suggestions? Here is the example HTML I'm trying to parse:
<ul>
<li>
<header>
<h2>Test</h2>
</header>
</li>
<li>
<header>
<h2>Test 2</h2>
</header>
</li>
<li>
<header>
<h2>Test 3</h2>
</header>
</li>
</ul>
I need to grab the text of each h2 element.