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

  • Home
  • SEARCH
  • 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 8220427
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T13:30:51+00:00 2026-06-07T13:30:51+00:00

I’m working on an application in C# that goes to a website and gets

  • 0

I’m working on an application in C# that goes to a website and gets some content out of a table. It’s working fine, but here is the problem: the table that I’m getting the content of changes as I select a different value in a combobox. The Xpath that I use always gets the table that is first shown on the website and I don’t know how to get the other ones. I’m posting here everything I think is useful for you to help me.

The webpage is:
http://br.soccerway.com/national/brazil/serie-a/2012/regular-season/

xpath/C# code:

HtmlNodeCollection no2 = doc.DocumentNode
   .SelectNodes("//*[@id='page_competition_1_block_competition_matches_summary_6']/div[2]/table/tbody/tr/td[@class='team team-a ' or @class='date no-repetition' or @class='score-time score' or     @class='team team-b ']");

On the website, you have to click on the “Por semana de jogo” option, right above the scores, for the combobox to be visible.

I need to get all the scores from all the tables, not just the one that appears.

  • 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-07T13:30:53+00:00Added an answer on June 7, 2026 at 1:30 pm

    So when you select a game week from the drop down (or click the “anterior” or “proximo” links above the drop down), the JavaScript in the page makes a call to the server to get the data for the selected game week. It just sends a URL to the server via GET.

    The data is returned in the form of a JSON object, and inside this object is the table HTML. This HTML is loaded into the DOM in the right place and presto, the browser displays the data for that week.

    It is a bit of work to get this programmatically, but it can be done. What you can do is determine what the URL is for each week. Hopefully, most of the query strings are constant except for the week in question. So you will have a boilerplate URL that you tweak for the week you want, and send it off to the server. You get the JSON back and parse out the table HTML. Then, you’re golden: you just feed that HTML into the Agility Pack and work with it as usual.

    I did a little investigation, and using Chrome’s Developer Tools, in the Network tab, I found that when I selected a game week, the URL that is sent off to the server looks like so (this is for week 14):

    http://br.soccerway.com/a/block_competition_matches_summary?block_id=page_competition_1_block_competition_matches_summary_6&callback_params=%7B%22page%22%3A%229%22%2C%22round_id%22%3A%2217449%22%2C%22outgroup%22%3A%22%22%2C%22view%22%3A%221%22%7D&action=changePage&params=%7B%22page%22%3A13%7D

    (Note that you can also use other tools, such as Firebug in FireFox or Fiddler to get the URL).

    By trying other weeks and comparing, it looks like the (selected week – 1) is found in near the end in the params query string: “…%3A13…”. So for week 15 you’d use “…%3A14…”. Fortunately it looks like there is only one more area of difference among the URLs for different weeks and it is in the callback_params query string. Unfortunately, I wasn’t able to figure out how it connects to the selected week, but hopefully you can.

    So when you feed that URL into your browser, you get back the JSON block. If you search for “<table” and “/table>” you’ll see the HTML that you want. In your C# code, you can just use a simple regular expression to parse it out of the JSON string:

    string json = "..." // load the JSON string here
    
    RegexOptions options = RegexOptions.IgnoreCase | RegexOptions.Singleline;
    Regex regx = new Regex( "(?<theTable><table.*/table>)", options );
    
    Match match = regx.Match( json );
    
    if ( match.Success ) {
        string tableHtml = match.Groups["theTable"].Value;
    }
    

    Feed the HTML string into the Agility Pack and you should be on your way.

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

Sidebar

Related Questions

I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text
I used javascript for loading a picture on my website depending on which small

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.