Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7809215
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T03:21:39+00:00 2026-06-02T03:21:39+00:00

I am trying to parse the table below but unfortunately each of nodes seems

  • 0

I am trying to parse the table below but unfortunately each of nodes seems nested each other. 🙁 It is impossible to get the childnodes because it is always giving the count = 1

It is really interesting but it is finding; for example the next “tr” as the childnode of the previous tr?

Do you have any idea?

<table width="292px" border="0">
    <tr>
        <td>
        </td>
    </tr>
    <tr>
        <td>
            <table>
                <tr>
                    <td colspan="2" bgcolor="#FBCE9D" align="center" height="40">
                    </td>
                </tr>
                <tr>
                    <td bgcolor="#FFF4D2" height="25" width="60">
                    </td>
                    <td height="25" bgcolor="#e8e8e8">
                    </td>
                </tr>
                <tr>
                    <td bgcolor="#FFF4D2" height="25" width="60">
                    </td>
                    <td height="25" bgcolor="#e8e8e8">
                    </td>
                </tr>
                <tr>
                    <td bgcolor="#FFF4D2" height="25" width="60">
                    </td>
                    <td height="25" bgcolor="#e8e8e8">
                    </td>
                </tr>
                <tr>
                    <td bgcolor="#FFF4D2" height="25" width="60">
                    </td>
                    <td height="25" bgcolor="#e8e8e8">
                    </td> //Here is a missing "</tr>" and I think this one is confusing the agilitypack!
                    <tr>
                        <td bgcolor="#FFF4D2" height="35" colspan="2" align="center">
                        </td>
                    </tr>
            </table>
        </td>
    </tr>
</table>

My code is:

var webGet = new HtmlWeb();
var doc = webGet.Load("the url where this table is located");
HtmlNodeCollection tb = doc.DocumentNode.SelectNodes("//table[@width='292px']");
                        var table = tb[0].ChildNodes[1].ChildNodes[0].ChildNodes[0].ChildNodes;
                        for (var na = 0; na < table.Count; na++)
                        { .....do the work.... }

Actually this code was working like a charm before but they nested another table inside it is stucking with ChildNodes[1] because there will be no ChildNodes[1] it is always ChildNodes[0]?

One more note; Firebug shows “/html/body/table/tbody/tr[2]/td/table/tbody” as the XPath of the nested table but as you may notice that “tbody” is not familiar with htmlagility because it is dynamically produced by the browser to eleminate the missing close tag /tr

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T03:21:42+00:00Added an answer on June 2, 2026 at 3:21 am

    It is really interesting but the problem was HmtlAgility pack that is actually available at Nuget! I removed it and download it from the web (http://htmlagilitypack.codeplex.com/). It is working now!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been trying to parse the bottom table on this site using different
I am trying to use preg_replace function to parse this table in a Html
Trying to parse Maplines for an airport. Each airport can have X number of
Trying to parse some XML but apparently this is too much for a lazy
Below is the XML I'm trying to parse with DOM, my code and my
I am trying to use NSXMLParser to parse the data below: <FORM ACTION=/prod/bwckgens.p_proc_term_date METHOD=POST
I am currently having a bit of an issue trying to parse a table
I'm trying to get links from table in HTML. By using HTML::TableExtract , I'm
I am trying to parse a bit of data from an HTML file, but
ok so I am trying to parse XML data into a table, this is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.