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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T15:36:14+00:00 2026-05-21T15:36:14+00:00

I’m trying to do some screen scraping, and discovered the HTML AgilityPack, but am

  • 0

I’m trying to do some screen scraping, and discovered the HTML AgilityPack, but am having some trouble figuring out how to use it with VB.net.

The first thing I want to do is find the URL string for an HREF tag if I know the text that is enclosed in the HREF.

The second thing is that I want to do is parse an HTML table, going through each row, and pulling out the data so I can save it to a database (after some basic analysis).

  • 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-21T15:36:15+00:00Added an answer on May 21, 2026 at 3:36 pm

    Here is a good starting link here on SO: How to use HTML Agility pack

    See also this: HtmlAgilityPack example for changing links doesn't work. How do I accomplish this?

    And this: Finding all the A HREF Urls in an HTML document (even in malformed HTML)

    To find a specific HREF, the xpath syntax would be “//a[@href=’your url’]”, meaning: “get any A tag that has an HREF attribute equal to ‘your url’.

    EDIT:

    To find an HREF if you only know the text, for example if you have the html text ‘<a href="homepage.html">Cars</a>‘ and look for homepage.html, then this is how you would do it.

            string s = @"<a href=""homepage.html"">Cars</a>";
    
            HtmlDocument doc = new HtmlDocument();
            doc.LoadHtml(s);
    
            HtmlNode node = doc.DocumentNode.SelectSingleNode("//a[text()='Cars']");
            Console.WriteLine("href=" + node.GetAttributeValue("href", null));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

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.