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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T08:27:58+00:00 2026-06-16T08:27:58+00:00

I want to put one table from Wikipedia into xml file and then parse

  • 0

I want to put one table from Wikipedia into xml file and then parse it to C#. Is it possible? If yes, can I save in xml only Title and Genre column?

HtmlWeb web = new HtmlWeb();
HtmlDocument doc = web.Load("http://en.wikipedia.org/wiki/2012_in_film");

HtmlNode node = doc.DocumentNode.SelectSingleNode("//table[@class='wikitable']");
  • 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-16T08:27:59+00:00Added an answer on June 16, 2026 at 8:27 am

    You can use a web browser:

    //First navigate to your address
     webBrowser1.Navigate("http://en.wikipedia.org/wiki/2012_in_film");
            List<string> Genre = new List<string>();
            List<string> Title = new List<string>();
      //When page loaded
      foreach (HtmlElement table in webBrowser1.Document.GetElementsByTagName("table"))
                {
                    if (table.GetAttribute("className").Equals("wikitable"))
                    {
                        foreach (HtmlElement tr in table.GetElementsByTagName("tr"))
                        {
                            int columncount = 1;
                            foreach (HtmlElement td in tr.GetElementsByTagName("td"))
                            {
                                //Title
                                if (columncount == 4)
                                {
                                    Title.Add(td.InnerText);
                                }
                                //Genre
                                if (columncount == 7)
                                {
                                    Genre.Add(td.InnerText);
                                }
                                columncount++;
                            }
    
                        }
                    }
                }
    

    now you have two list (genre and title).
    you can simply convert them to xml file

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

Sidebar

Related Questions

I want to insert data from one table into another where one field equals
I want to put the apk file into the Kindle Fire storage(through USB cable)
I want to use SELECT INTO to make a temporary table in one of
I mean I have one line and I want to put 2 spinner in
hey, hi i want put limit on object creation means a class can have
I want to put all my resources into a ClientBundle for easy management. So
I reworked my database from one user table to multiple user tables (divided per
So I have a normalized table with some data that I want to put
I need to copy some data from one table to another but I need
Hey at the moment we have an arrray selecting all from one table (relationship)

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.