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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T22:55:06+00:00 2026-05-28T22:55:06+00:00

I am using HtmlAgility pack for parsing the html page. I am able to

  • 0

I am using HtmlAgility pack for parsing the html page. I am able to locate my section from where i have to get data.Actually its a table and i have to parse its tr.
Basically, I have two queries.

  1. When i load a page in parser, it took around 20-30 secs to load it in memory and there are around 4738 web pages to parse. So, I want to reduce it….I want to know Can I use delegate call the method in a loop so that i can reduce the time of delay. Or Is there any efficient way to do so. Please guide me thru that.

  2. I am getting my row as "\r\n\t\t\t\t<td style=\"width:20%;\">110001</td><td style=\"width:25%;\">New Delhi</td><td style=\"width:25%;\">Delhi</td><td style=\"width:30%;\">Baroda House</td>\r\n\t\t\t", from the above I have to parse 11001, New Delhi, Delhi and Baroda House. Actually I am having a class Pincodes where I have the properties Pincode, Area, State and District. So I need a regex or some way to put these values to the class.

Finally I have to push these records to my database where i am using Linq2Sql. So keeping all the things, please tell give me solution. Any reference or link will be a great help.

My Code:

  var url = @"http://www.eximguru.com/traderesources/pincode.aspx?&GridInfo=Pincode01";
            var web = new HtmlWeb();
            var doc = web.Load(url);
            //doc.DocumentNode.SelectSingleNode("//*[@id=\"lst-ib\"]");//("/html/body/div[2]/form/div/div[2]/table/tbody/tr/td/table/tbody/tr/td/div/table/tbody/tr/td/table/tbody/tr/td[2]/div/input");
            //System.Console.WriteLine(doc.DocumentNode.SelectSingleNode("//*[@id=\"lst-ib\"]").Id);
            var htmlNode =
                doc.DocumentNode.SelectSingleNode(
                    "//*[@id=\"ctl00_uxContentPlaceHolder_ResourceAndGuideUserControl1_ResourceAndGuideGrid_myGridView_mainGridView\"]");

Thanks in advance

  • 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-28T22:55:06+00:00Added an answer on May 28, 2026 at 10:55 pm

    It doesn’t look like there’s a pattern to the urls, ids or anything else on that page. It was poorly designed. If there was a nice pattern to it (such as the different page numbers for the results), then perhaps this could be done in parallel. Since it isn’t, you’d have to do it sequentially since there’s no reliable method (that I can see) to get the url to the next page.

    var url = "http://eximguru.com/traderesources/pincode.aspx?&GridInfo=Pincode01";
    var web = new HtmlWeb();
    var results = new List<Pincode>();
    while (!String.IsNullOrWhiteSpace(url))
    {
        var doc = web.Load(url);
        var query = doc.DocumentNode
            .SelectNodes("//div[@class='Search']/div[3]//tr")
            .Skip(1)
            .Select(row => row.SelectNodes("td"))
            .Select(row => new Pincode
            {
                PinCode = row[0].InnerText,
                District = row[1].InnerText,
                State = row[2].InnerText,
                Area = row[3].InnerText,
            });
        results.AddRange(query);
    
        var next = doc.DocumentNode
            .SelectSingleNode("//div[@class='slistFooter']//a[last()]");
        if (next != null && next.InnerText == "Next")
        {
            url = next.Attributes["href"].Value;
        }
        else
        {
            url = null;
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am parsing an html page using the Html Agility Pack . I am
I am using HTML Agility Pack to parse html content. I am using parsing
I'm using Html Agility Pack to run xpath queries on a web page. I
I am trying to use the HTML Agility pack to scrape some data from
I am currently using HtmlAgility Pack to parse some HTML for a forms input
My app is using htmlagility pack. As of right now I can get all
Just tried using the HtmlAgility Pack for the first time and have a problem.
Using the html agility pack; how would I extract an html fragment from a
I am parsing a web page with the HTML agility pack in vb.net and
I'm trying to get google search results using HTML Agility Pack, but I am

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.