How can this be done? The .InnerText Property (when used on the containing div element) is giving me the html only. Is it possible to iterate through all the li elements contained and extract their values?
How can this be done? The .InnerText Property (when used on the containing div
Share
From comment of the OP:
In this case one can just use the following XPath expression:
This selects all text nodes that are descendents of all
lielements that are descendents of anydivelement that is a child of the current node.Using an XPath expression to select nodes in an XML (and HTML5 is well-formed XML) is the recommended, most straightforward and more reliable way than doing this with difficult to construct, difficult to test and difficult to understand and maintain regular expressions.
Here is a complete code example:
when the above application is executed, the wanted, correct result is produced: