Need to create a summary/indice
For this I have tags <Document-Title> My Title </Document-Title>
How I get these tags using HTML agility pack?
I have tried this:
HtmlDocument html = new HtmlDocument();
html.Load(new StringReader(Document.Content)); //Is the <html> I'm load in database
var titles = html.DocumentNode.SelectNodes("//Document-Title");
But titles is null
Just use //document-title
, it jsut need to be lowercase, HAP lowercases the tags by default, i believe the reason is that xHTML required the tag names to be lower-case, so HAP probably considered that, but its not specific to standard HTML, its fine to use tags with capitalization.
Update: after some research lower case is an xpath requirement, HAP is case insenstive on its own and does not care about XHTML.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With