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 9063279
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T15:57:24+00:00 2026-06-16T15:57:24+00:00

A continuation of this post , I am trying to parse out some data

  • 0

A continuation of this post, I am trying to parse out some data from an HTML page. Here is the HTML (there is more info on the page, but this is the important section):

<table class="integrationteamstats">
<tbody>
<tr>
    <td class="right">
        <span class="mediumtextBlack">Queue:</span>
    </td>
    <td class="left">
        <span class="mediumtextBlack">0</span>
    </td>
    <td class="right">
        <span class="mediumtextBlack">Aban:</span>
    </td>
    <td class="left">
        <span class="mediumtextBlack">0%</span>
    </td>
    <td class="right">
        <span class="mediumtextBlack">Staffed:</span>
    </td>
    <td class="left">
        <span class="mediumtextBlack">0</span>
    </td>
</tr>
<tr>
    <td class="right">
        <span class="mediumtextBlack">Wait:</span>
    </td>
    <td class="left">
        <span class="mediumtextBlack">0:00</span>
    </td>
    <td class="right">
        <span class="mediumtextBlack">Total:</span>
    </td>
    <td class="left">
        <span class="mediumtextBlack">0</span>
    </td>
    <td class="right">
        <span class="mediumtextBlack">On ACD:</span>
    </td>
    <td class="left">
        <span class="mediumtextBlack">0</span>
    </td>
</tr>
</tbody>
</table>

I need to get 2 pieces of information: the data inside of the td below Queue and the data inside the td below Wait (so the Queue count and wait time). Obviously the numbers are going to update frequently.

I have gotten to the point where the HTML is pilled into an HtmlDocument variable. And I’ve found something along the lines of using an HtmlNodeCollection to gather nodes that meet a certain criteria. This is basically where I am stuck:

HtmlNodeCollection tds = 
    new HtmlNodeCollection(this.html.DocumentNode.ParentNode);
tds = this.html.DocumentNode.SelectNodes("//td");

foreach (HtmlNode td in tds)
{
    /* I want to write:
     * If the last node's value was 'Queue', give me the value of this node.
     * and
     * If the last node's value was 'Wait Time', give me the value of this node.
     */
}

And I can go through this with a foreach, but I am not certain how to access the value or how to get the next value.

  • 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-16T15:57:26+00:00Added an answer on June 16, 2026 at 3:57 pm

    Generally, there’s no need to go through with a foreach as getting the targeted information is pretty easy (with a foreach you’d have to manage the state of each iteration of the loop and it’s really unwieldy).

    First, you want to get the table. Filtering on the class attribute is generally a bad idea, as you can have multiple elements in an HTML document that have the class applied to it. If you had an id attribute, that would be ideal.

    That said, if this is the only table with this class, then you can get the body of the table element using:

    // Get the table.
    HtmlNode tableBody = document.DocumentNode.SelectSingleNode(
        "//table[@class='integrationteamstats']/tbody");
    

    From there, you want to get the individual rows. Since these are direct children of the tbody element, you can get the rows by position through the ChildNodes property, like so:

    HtmlNode queueRow = tableBody.ChildNodes[0];
    HtmlNode waitRow = tableBody.ChildNodes[1];
    

    Then you want the second td element in each row. While there’s a span tag in there that wraps the content, you want all of the text that’s in the td element in it’s entirety, you can use the InnerText property to get the value:

    string queueValue = queueRow.ChildNodes[1].InnerText;
    string waitValue = waitRow.ChildNodes[1].InnerText;
    

    Note, there’s replication here, so if you find there are a lot of rows that you have to parse like this, you might want to factor out some of the logic into helper methods.

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

Sidebar

Related Questions

This question is in continuation to my previous post located here . Since there
This is a continuation of the post How does one access a method from
This is a continuation of this question from yesterday . Here are my three
This is a continuation from a previous stackoverflow question. I've renamed some variables so
This is a continuation question I had from a post yesterday: Initializing NSMutableDictionary (It's
This is a continuation of sorts from my prior post: RowNumber() and Partition By
In a continuation from this question . I'm trying to bind a given function
This is a continuation from this: Is there an easy way to check multiple
This is a continuation from this post I have a set of random sized
this is a continuation of the previous post. I need to change some parameters(strings)

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.