CsQuery to parse a collection of li items

milar

New Member
Here's my code:\[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"];}\[/code\]Inside the foreach loop \[code\]li\[/code\] turns into a \[code\]IDomObject\[/code\] variable and I can no longer drill down further into it.Any suggestions? Here is the example HTML I'm trying to parse:\[code\]<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>\[/code\]I need to grab the text of each h2 element.
 
Back
Top