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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T21:36:38+00:00 2026-05-22T21:36:38+00:00

Here’s a link: http://www.covers.com/pageLoader/pageLoader.aspx?page=/data/nba/results/2010-2011/boxscore819588.html I’m using HTML Agility Pack and I would like to

  • 0

Here’s a link:

http://www.covers.com/pageLoader/pageLoader.aspx?page=/data/nba/results/2010-2011/boxscore819588.html

I’m using HTML Agility Pack and I would like to extract, say, the 188 from the ‘Odds’ column. My editor gives /html/body/form/div/div[2]/div/table/tr/td[2]/div/table/tr[3]/td[7] when asked for path. I tried that path with various of omissions of body or html, but neither of them return any results when passed to .DocumentNode.SelectNodes(). I also tried with the // at the beginning (which, I assume, is the root of the document tree). What gives?

EDIT:

Code:

        WebClient client = new WebClient();
        string html = client.DownloadString(url);
        HtmlDocument doc = new HtmlDocument();
        doc.LoadHtml(html);

        foreach(HtmlNode node in doc.DocumentNode.SelectNodes("/some/xpath/expression"))
        {
            Console.WriteLine("[" + node.InnerText + "]");
        }
  • 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-22T21:36:39+00:00Added an answer on May 22, 2026 at 9:36 pm

    When scraping sites, you can’t rely safely on the exact XPATH given by tools as in general, they are too restrictive, and in fact catch nothing most of the time. The best way is to have a look at the HTML and determine something more resilient to changes.

    Here is a piece of code that works with your example:

        HtmlAgilityPack.HtmlDocument doc = new HtmlAgilityPack.HtmlDocument();
        doc.Load(your html);
    
        foreach (HtmlNode node in doc.DocumentNode.SelectNodes("//a[text()='MIA']/ancestor::tr/td[7]"))
        {
            Console.WriteLine(node.InnerText.Trim());
        }
    

    It outputs 188.

    The way it works is:

    • select an A element with inner text set to “MIA”
    • find the parent TR element of this A element
    • get to the seventh TD of this TR element
    • and then we use InnerText property of that TD element
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's my code in the <head></head> : <link rel=stylesheet href=http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css /> <script type=text/javascript src=http://code.jquery.com/jquery-1.7.1.min.js></script>
here is the site : http://www.notrepanorama.com at the bottom left, i use a jquery
Here's a piece of code I copied from http://www.schillmania.com/content/projects/javascript-animation-1/demo/ Very simple JS animation: function
Here is my persistence.xml : <?xml version=1.0 encoding=UTF-8?> <persistence xmlns=http://java.sun.com/xml/ns/persistence xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xsi:schemaLocation=http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd version=1.0>
here is my configuration: http://domain.com (obviously fictitious name...) hosted on a server running Apache
Here is the code I'm using http://jsbin.com/evike5/edit When the jQuery UI dialog is fired
Here the scenario is I have many .aspx pages if any page gives error,
here is a link to how my APC is running : [removed] As you
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
Here's the code I'm running. Basically I scrape data, and place them into simple

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.