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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T06:08:04+00:00 2026-05-25T06:08:04+00:00

I am parsing an HTML file and having a few issues. I am using

  • 0

I am parsing an HTML file and having a few issues.

I am using the below code:

EDIT********************************

Updated Code now working.

private void PhoneApplicationPage_Loaded(object sender, RoutedEventArgs e)
{

    WebClient client = new WebClient();
    client.DownloadStringCompleted += new DownloadStringCompletedEventHandler(client_DownloadStringCompleted);

    client.DownloadStringAsync(new Uri(@"http://www.SourceURL.com"));

}

void client_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
{
    var html = e.Result;

    var doc = new HtmlDocument();
        doc.LoadHtml(html);

    var list = doc.DocumentNode.Descendants("div").ToList();


    var node = doc.DocumentNode.Descendants("div")
        .FirstOrDefault(x => x.Id == "FlightInfo_FlightInfoUpdatePanel")
        .Element("table")
        .Element("tbody")
        .Elements("tr").Aggregate("Flight list\n", (acc, n) => acc + "\n" + n.InnerHtml);
       // .Elements("td")

    this.scrollViewer1.Content = node;




       }

    }
}

This is giving me this result.

enter image description here

All results are now being disaplayed as required.

My Question was : How can I change this code to display all the results under all <tr>'s

edit############################ XAML

ListBox Margin="6,6,-12,0" Name="listBox1">
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <StackPanel Margin="0,0,0,17" Width="432" Height="Auto">

                            <TextBlock Text="{Binding Flight}" Foreground="#FF4BCCF5" FontSize="24" />
                            <TextBlock Text="{Binding Origin}" TextWrapping="Wrap" FontSize="22" Foreground="#FF969696" />
                            <TextBlock Text="{Binding Date}" TextWrapping="Wrap" FontSize="20" Foreground="#FF05C16C" />
                            <TextBlock Text="{Binding Time}" TextWrapping="Wrap" FontSize="20" />
                        </StackPanel>
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>
  • 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-05-25T06:08:04+00:00Added an answer on May 25, 2026 at 6:08 am

    Assuming you have the same methods available on as when using XElement this should do the trick

    var text = list.Descendants("div")
                     .FirstOrDefault(x => x.Id == "FlightInfo_FlightInfoUpdatePanel")
                     .Element("table")
                     .Element("tbody")
                     .Descendants("tr").Aggregate("",(acc,n)=>acc+"\n"+n.OuterHtml);
    
     this.textBlock2.Text = text;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having trouble parsing this xml file using jquery: <?xml version=1.0 encoding=utf-8?> <?mso-infoPathSolution name=urn:schemas-microsoft-com:office:infopath:BOT-Memos:-myXSD-2011-07-13T14-29-57
I'm parsing some data using DOMDocument after fetching HTML file using curl. The codes
I'm parsing an HTML file into a well-formed XML document using NekoHTML parser. However
I have some PHP code (written by someone else) that's parsing a html file
I am parsing the html file to extract tabular information through column names. And
I am parsing the tabular information from the html file with the help of
I am doing mail parsing application which required to convert the HTML file to
I'm new to DOM parsing in PHP: I have a HTML file that I'm
I am parsing html file with the help of the html agility pack to
I'm new to using the Perl treebuilder module for HTML parsing and can't figure

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.