I want to parse some complex/heavy HTML pages. I recently read about CsQuery and checked the performance comparation of CsQuery Vs Html Agility Pack and Fizzler . According to these tests, CsQuery turns to be slower when creating the DOM due to its index creation.
Let's say I want to select certain element (without an id) of a heavy html page, and I know the ID of an ancestor of it, which I will use as a context element. If I load this heavy html into DOM, it will be slow, therefore my selection will be slow. However, if I can SOMEHOW FAST pre-process the html and get the sub-string containing the context element (which ID I know) and load that into DOM, it will be faster. In that case I would have gotten rid of lots of unneeded HTML for which indexers will not be created. Therefore, my selection will be faster.
I am using CsQuery because I want something JQuery-like.
My question is:
Given an HTML document string: Is there a FAST WAY (eg: linear) to get the HTML sub-string of an HTML element given its id?