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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:04:58+00:00 2026-05-26T09:04:58+00:00

I have a C# Form with WebBrowser object. This object contains HTML Document. And

  • 0

I have a C# Form with WebBrowser object.
This object contains HTML Document.
And there is a link in that document that has no markers (no id and no name)
How can I access this element??

I tried to use this:

webBrowser1.Document.GetElementsByTagName("a")[n] 

But it is not very useful, because if there will be some new link on the page, I’ll need to rebuild all program.

I also can not do loops through document, or get a substring of Document.ToString() because then I can not click the link.

Would be great if you could give me some advice.

  • 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-26T09:04:58+00:00Added an answer on May 26, 2026 at 9:04 am

    In this kind of situation the best idea is always to find an “Anchor”, meaning – a place in the document that never change.

    Lets say that

    <a href="http://site.com">dada</a>
    

    Doesn’t have an ID or Name, so the closest you can go is check if the parent of the element you’re looking for has an ID.

    <div id="parentDiv">
          Some text
          Some other stuff
          <a href="http://site.com">The link you're looking for</a>
    </div>
    

    That way you could get the parentDiv, which you know doesn’t change, and then the A tag inside that parent (which should be permanent unless that website completely changes the structure which is one of the problems in parsing external HTML pages)

    Shai.

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

Sidebar

Related Questions

We have a form that hosts the WebBrowser control. That is the only control
I have a WinForms C# application. There is a WebBrowser control on the form
I have a WebBrowser control that is created and added to the form during
So basically there is a made html form with a button, it doesnt have
I have this App that uses the Webbrowser control to do automated browsing. I
I have a WebBrowser in my form that accesses a website that is too
I have form that displays several keywords (standard set of choice lists that changes
i have form action file in another directory but some file send to this
I have form where user submits field. Field can have letters, numbers, and punctuation.
I have form, where some fields are looks like rows, so I can add/delete

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.