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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T01:39:59+00:00 2026-06-09T01:39:59+00:00

I have scraped a table from a website using C# for my own website

  • 0

I have scraped a table from a website using C# for my own website and loaded it into a string. There are too many columns so I was wondering if there was an easy way to delete some, probably using HTML Agility Pack but in C# if necessary.

The table in the string looks like this:

    <table>
        <tr>
            <th scope="col">&nbsp; </th>
            <th scope="col">&nbsp; </th>
            <th scope="col">P </th>
            <th scope="col">W </th>
            <th scope="col">L </th>
            <th scope="col">T </th>
            <th scope="col">NR </th>
            <th scope="col">Bat </th>
            <th scope="col">Bowl </th>
            <th scope="col">Pen </th>
            <th scope="col">Pts </th>
        </tr>
        <tr>
            <td>1 </td>
            <td><a href="fixbyteam.aspx?clubid=44576&teamid=58170&divid=32181">Rayleigh 2nd</a> </td>
            <td>12 </td>
            <td>8 </td>
            <td>1 </td>
            <td>0 </td>
            <td>3 </td>
            <td>14 </td>
            <td>52 </td>
            <td>0 </td>
            <td>209 </td>
        </tr>
        <tr>
            <td>2 </td>
            <td><a href="fixbyteam.aspx?clubid=44612&teamid=58169&divid=32181">Rainham 1st</a> </td>
            <td>12 </td>
            <td>8 </td>
            <td>1 </td>
            <td>1 </td>
            <td>2 </td>
            <td>12 </td>
            <td>56 </td>
            <td>-15 </td>
            <td>199 </td>
        </tr>
        <tr class="lineAbove">
            <td>3 </td>
            <td><a href="fixbyteam.aspx?clubid=44571&teamid=58162&divid=32181">Old Chelmsfordians 2nd</a> </td>
            <td>12 </td>
            <td>5 </td>
            <td>5 </td>
            <td>0 </td>
            <td>2 </td>
            <td>10 </td>
            <td>48 </td>
            <td>0 </td>
            <td>148 </td>
        </tr>
        <tr>
            <td>4 </td>
            <td><a href="fixbyteam.aspx?clubid=44570&teamid=58161&divid=32181">Little Baddow 2nd</a> </td>
            <td>12 </td>
            <td>5 </td>
            <td>4 </td>
            <td>0 </td>
            <td>3 </td>
            <td>21 </td>
            <td>43 </td>
            <td>-15 </td>
            <td>144 </td>
        </tr>
        <tr>
            <td>5 </td>
            <td><a href="fixbyteam.aspx?clubid=44606&teamid=58159&divid=32181">Rayne 1st</a> </td>
            <td>12 </td>
            <td>5 </td>
            <td>4 </td>
            <td>0 </td>
            <td>3 </td>
            <td>6 </td>
            <td>39 </td>
            <td>0 </td>
            <td>140 </td>
        </tr>
        <tr>
            <td>6 </td>
            <td><a href="fixbyteam.aspx?clubid=44605&teamid=58158&divid=32181">Terling 1st</a> </td>
            <td>12 </td>
            <td>4 </td>
            <td>5 </td>
            <td>1 </td>
            <td>2 </td>
            <td>12 </td>
            <td>35 </td>
            <td>0 </td>
            <td>129 </td>
        </tr>
        <tr>
            <td>7 </td>
            <td><a href="fixbyteam.aspx?clubid=44602&teamid=58154&divid=32181">Willow Herbs 1st</a> </td>
            <td>12 </td>
            <td>4 </td>
            <td>6 </td>
            <td>0 </td>
            <td>2 </td>
            <td>9 </td>
            <td>34 </td>
            <td>0 </td>
            <td>117 </td>
        </tr>
        <tr>
            <td>8 </td>
            <td><a href="fixbyteam.aspx?clubid=50925&teamid=68864&divid=32181">Ongar 1st</a> </td>
            <td>12 </td>
            <td>3 </td>
            <td>5 </td>
            <td>0 </td>
            <td>4 </td>
            <td>3 </td>
            <td>42 </td>
            <td>-5 </td>
            <td>108 </td>
        </tr>
        <tr class="lineAbove">
            <td>9 </td>
            <td><a href="fixbyteam.aspx?clubid=44607&teamid=58163&divid=32181">Sandon Sports 1st</a> </td>
            <td>12 </td>
            <td>3 </td>
            <td>6 </td>
            <td>0 </td>
            <td>3 </td>
            <td>8 </td>
            <td>27 </td>
            <td>0 </td>
            <td>98 </td>
        </tr>
        <tr>
            <td>10 </td>
            <td><a href="fixbyteam.aspx?clubid=44582&teamid=58156&divid=32181">Little Waltham 2nd</a> </td>
            <td>12 </td>
            <td>1 </td>
            <td>9 </td>
            <td>0 </td>
            <td>2 </td>
            <td>14 </td>
            <td>25 </td>
            <td>0 </td>
            <td>65 </td>
        </tr>
    </table>

And I want to delete columns 8-10 (Bat, Bowl and Pen). I’m not really sure where to start so any pointers would be helpful!

  • 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-09T01:40:04+00:00Added an answer on June 9, 2026 at 1:40 am

    You would need to iterate over each tr and remove the 8th, 9th and 10th td nodes from each.

    bool first = true;
    foreach (HtmlNode row in doc.DocumentNode.SelectNodes("//tr"))
    {
        if (first)
        {
            row.RemoveChild(row.SelectSingleNode("th[10]"));
            row.RemoveChild(row.SelectSingleNode("th[9]"));
            row.RemoveChild(row.SelectSingleNode("th[8]"));
            first = false;
        }
        else
        {
            row.RemoveChild(row.SelectSingleNode("td[10]"));
            row.RemoveChild(row.SelectSingleNode("td[9]"));
            row.RemoveChild(row.SelectSingleNode("td[8]"));
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Into : Currently i have scraped all the data into one PostgreSQL 'Bigtable' table(there
I already have data I scraped from a web table and I've noticed some
I have a strong that I scraped from an XML file and It contains
I have just changed a column (called time) from t.string to t.datetime and then
I have a bunch of URLs stored in a table waiting to be scraped
I am using watir-webdriver to scrape from a page with nested table based layout.
I have a table, of whose number of columns can change depending on the
I have a Wordpress based website that I scrap using wget. I have articles
The HTML you see below is text I have scraped from a remote site,
I need to scrape some website data from a table on a website and

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.