Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

get link text from IE page

Status
Not open for further replies.

Horrid

Programmer
May 20, 1999
373
I'm trying to get all the links out of a web page, getting the urls the links go to isn't a problem, but does anyone know how to get the link text.

eg <a href=demo.html> I WANT THIS TEXT </a>
anything inside the <a href> part is not a problem, IE exposes all the methods required to get that out but it seems to lack methods for getting the visible link text.

Basically what I want to end up doing to capturing the text of the link when they click on it, currently I can only get the url.

I am using the IHTML interfaces to access the pages.

Thanks in advance
 
I was going one step too far. I looped through every element, checked if its tag name was &quot;A&quot; (ancor) then obtained its innerText property.
Before I was getting the ancor object for every ancor element but that was one step more than I needed.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top