I'd like to parse html page using C#. There are html pages which contain a lot of html tags, here's a sample of one of them :
<span class=text14 id="article_content"><!-- RELEVANTI_ARTICLE_START --><span ></b>The
most important component for <a
class=bluelink href="http://www.ynetnews.com/articles/0,7340,L-
3284752,00.html%20"' onmouseover='this.href=unescape(this.href)'
target=_blank>Israel</a>'s
security is its special relations with the American administration, and especially with its generous purse. When the Netanyahu government launches a great outcry against the <a ...
but I'd only like to get the content wrapped by the <span class=text14 id="article_content">
tag.
At first I've thought about using preg match, but then realized it's not efficient at all.
I've later read about Html Agility Pack and FizzlerEx -
i'd like to know whether it's possible to get the text wrapped by the specific tag i've mentioned using these tools, and i'd be grateful if someone could tell me how fast this task could be performed.
O(length_of_html)
and lookup speed will depend on your actual criteria to search, but likelyO(1)
if you just need to search byid
.id
is enough as it is unique in each document - soO(1)
unless HtmlAgilityPack does not optimize that search.