C# - Parse HTML source as XML

Posted by fonix232 on Stack Overflow See other posts from Stack Overflow or by fonix232
Published on 2010-06-10T16:24:53Z Indexed on 2010/06/10 16:32 UTC
Read the original article Hit count: 299

Filed under:
|
|
|

I would like to read in a dynamic URL what contains a HTML file, and read it like an XML file, based on nodes (HTML tags). Is this somehow possible?

I mean, there is this HTML code:

            <table class="bidders" cellpadding="0" cellspacing="0"> 

            <tr class="bidRow4"> 
                <td>kucik (automata)</td> 
                <td class="right">9 374 Ft</td> 
                <td class="bidders_date">2010-06-10 18:19:52</td> 
            </tr> 

            <tr class="bidRow4"> 
                <td>macszaf (automata)</td> 
                <td class="right">9 373 Ft</td> 
                <td class="bidders_date">2010-06-10 18:19:52</td> 
            </tr> 

            <tr class="bidRow2"> 
                <td>kucik (automata)</td> 
                <td class="right">9 372 Ft</td> 
                <td class="bidders_date">2010-06-10 18:19:42</td> 
            </tr> 

            <tr class="bidRow2"> 
                <td>macszaf (automata)</td> 
                <td class="right">9 371 Ft</td> 
                <td class="bidders_date">2010-06-10 18:19:42</td> 
            </tr> 

            <tr class="bidRow0"> 
                <td>kucik (automata)</td> 
                <td class="right">9 370 Ft</td> 
                <td class="bidders_date">2010-06-10 18:19:32</td> 
            </tr> 

            <tr class="bidRow0"> 
                <td>macszaf (automata)</td> 
                <td class="right">9 369 Ft</td> 
                <td class="bidders_date">2010-06-10 18:19:32</td> 
            </tr> 

            <tr class="bidRow8"> 
                <td>kucik (automata)</td> 
                <td class="right">9 368 Ft</td> 
                <td class="bidders_date">2010-06-10 18:19:22</td> 
            </tr> 

            <tr class="bidRow8"> 
                <td>macszaf (automata)</td> 
                <td class="right">9 367 Ft</td> 
                <td class="bidders_date">2010-06-10 18:19:22</td> 
            </tr> 

            <tr class="bidRow6"> 
                <td>kucik (automata)</td> 
                <td class="right">9 366 Ft</td> 
                <td class="bidders_date">2010-06-10 18:19:12</td> 
            </tr> 

            <tr class="bidRow6"> 
                <td>macszaf (automata)</td> 
                <td class="right">9 365 Ft</td> 
                <td class="bidders_date">2010-06-10 18:19:12</td> 
            </tr> 

        </table> 

I want to parse this into a ListView (or a Grid) to create rows with the data contained. All tr are different row, and all td in a given td is a column in the given row.

And also I want it to be as fast as possible, as it would update itself in 5 seconds.

Is there any library for this?

© Stack Overflow or respective owner

Related posts about c#

Related posts about html