Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You can just parse it into a dictionary and look it up that way. I could think of perhaps some better ways to parse it, but this does what you want.</p> <pre><code> void Main() { string html = @"&lt;tr&gt; &lt;td width=30 align=center bgcolor=#006699 class=W&gt;&lt;font color=white&gt;1&lt;/font&gt;&lt;/td&gt; &lt;td width=50 bgcolor=#FFFFFF align=center&gt;7387&lt;/td&gt; &lt;td width=30 height=25 align=center bgcolor=#006699 class=W&gt;&lt;font color=white&gt;2&lt;/font&gt;&lt;/td&gt; &lt;td width=50 bgcolor=#FFFFFF align=center&gt;2881&lt;/td&gt; &lt;td width=30 height=25 align=center bgcolor=#006699 class=W&gt;&lt;font color=white&gt;3&lt;/font&gt;&lt;/td&gt; &lt;td width=50 bgcolor=#FFFFFF align=center&gt;8782&lt;/td&gt; &lt;td width=30 height=25 align=center bgcolor=#006699 class=W&gt;&lt;font color=white&gt;4&lt;/font&gt;&lt;/td&gt; &lt;td width=50 bgcolor=#FFFFFF align=center&gt;5297&lt;/td&gt; &lt;td width=30 height=25 align=center bgcolor=#006699 class=W&gt;&lt;font color=white&gt;5&lt;/font&gt;&lt;/td&gt; &lt;td width=50 bgcolor=#FFFFFF align=center&gt;749&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td align=center bgcolor=#006699 class=W&gt;&lt;font color=white&gt;6&lt;/font&gt;&lt;/td&gt; &lt;td width=50 bgcolor=#FFFFFF align=center&gt;3136&lt;/td&gt; &lt;td height=25 align=center bgcolor=#006699 class=W&gt;&lt;font color=white&gt;7&lt;/font&gt;&lt;/td&gt; &lt;td width=50 bgcolor=#FFFFFF align=center&gt;8768&lt;/td&gt; &lt;td height=25 align=center bgcolor=#006699 class=W&gt;&lt;font color=white&gt;8&lt;/font&gt;&lt;/td&gt; &lt;td width=50 bgcolor=#FFFFFF align=center&gt;9548&lt;/td&gt; &lt;td height=25 align=center bgcolor=#006699 class=W&gt;&lt;font color=white&gt;9&lt;/font&gt;&lt;/td&gt; &lt;td width=50 bgcolor=#FFFFFF align=center&gt;6565&lt;/td&gt; &lt;td height=25 align=center bgcolor=#006699 class=W&gt;&lt;font color=white&gt;10&lt;/font&gt;&lt;/td&gt; &lt;td width=50 bgcolor=#FFFFFF align=center&gt;142&lt;/td&gt; &lt;/tr&gt;"; HtmlDocument doc = new HtmlDocument(); doc.LoadHtml(html); int[] nodes = doc.DocumentNode.SelectNodes("//td").Select ( dn =&gt; int.Parse(dn.InnerHtml.Contains("font") ? dn.FirstChild.InnerHtml : dn.InnerHtml) ).ToArray(); Dictionary&lt;int,int&gt; d = new Dictionary&lt;int,int&gt;(); for (int i = 0; i &lt; nodes.Length; i+=2) d.Add(nodes[i],nodes[i+1]); d.Dump(); d[1].Dump(); d[8].Dump(); } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload