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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T09:49:07+00:00 2026-05-25T09:49:07+00:00

I am currently trying to parse specfic Tables from a DIV in an HTML

  • 0

I am currently trying to parse specfic Tables from a DIV in an HTML doc.

I had this working windows Silverlight, but WP7 HTML agility pack seems to be a different thing altogether.

HTML Looks like this

<div id="FlightInfo_FlightInfoUpdatePanel">

   <table cellspacing="0" cellpadding="0"><tbody>
     <tr class="">
     <td class="airline"><img src="/images/airline logos/NZ.gif" title="AIR NEW ZEALAND LIMITED. " alt="AIR NEW ZEALAND LIMITED. " /></td>
     <td class="flight">NZ8</td>
     <td class="codeshare">&nbsp;</td>
     <td class="origin">San Francisco</td>
     <td class="date">01 Sep</td>
     <td class="time">17:15</td>
     <td class="est">18:00</td>
     <td class="status">DEPARTED</td>
     </tr>

I am currently using this code to parse the tables inside the “FlightInfo_FlightInfoUpdatePanel” DIV Box

using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;
using HtmlAgilityPack;

namespace Auckland_Airport
{
    public partial class MainPage : PhoneApplicationPage
    {
        // Constructor
        public MainPage()
        {
            InitializeComponent();
        }

        private void PhoneApplicationPage_Loaded(object sender, RoutedEventArgs e)
        {
            var doc = new HtmlDocument();
            doc.LoadHtml("http://www.SourceURL");

            var flightTableCell = doc.DocumentNode.Descendants("div")
                 .FirstOrDefault(x => x.ID = "FlightInfo_FlightInfoUpdatePanel")
                 .Element("table")
                 .Element("tbody")
                 .Elements("td")
                 .FirstOrDefault(x => x.Attributes.Contains("flight"));

            var value = flightTableCell.InnerText; 

This is producing an unhandled exception error:

MainPage.PhoneApplicationPage_Loaded(Object sender, RoutedEventArgs e)
   at MS.Internal.CoreInvokeHandler.InvokeEventHandler(Int32 typeIndex, Delegate handlerDelegate, Object sender, Object args)
   at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, String eventName)
  • 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-25T09:49:07+00:00Added an answer on May 25, 2026 at 9:49 am

    Try something like this then:

    var flightTableCell =
        doc.DocumentNode
            .Descendants("div")
            .FirstOrDefault(x => x.Id == "FlightInfo_FlightInfoUpdatePanel")
            .Element("table")
            .Element("tbody")
            .Elements("td")
            .FirstOrDefault(x => x.Attributes.Contains("flight"));
    
    var value = flightTableCell.InnerText;  
    this.textBlock1.Text = value;
    

    Since you can’t use xpath, you’re forced to manually traverse the DOM.

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

Sidebar

Related Questions

I'm trying to parse some returned html (from http://www.google.com/movies?near=37130 )to look for currently playing
I'm currently trying to parse the html page http://84.19.184.204:8000/played.html using JS. But it's been
I'm trying to parse an html output file from a program called mirdeep. I
I'm currently trying to iteratively parse a very large HTML document (I know.. yuck)
So I know how to parse some XML structures but I am currently trying
I'm currently trying to parse a document into tokens with the help of regex.
Currently I am trying to parse an xml string that I already have (no
I am currently trying to read from an xml file which records the jobs
I am trying to parse some HTML snippets and want to clean them up
I am currently trying to write a Treetop grammar to parse Simple Game Format

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.