From: bob on
Any ideas why IHTMLDocument2::get_anchors doesn't return all the
anchors in a page?

For instance, if I check http://www.coolgroups.com/desert2/, it says
there are none.

If I do IHTMLDocument2::get_all, the link is there. Any ideas?

From: Jeff Partch [MVP] on
<bob(a)coolgroups.com> wrote in message
news:1133980623.851282.9110(a)g44g2000cwa.googlegroups.com...
> Any ideas why IHTMLDocument2::get_anchors doesn't return all the
> anchors in a page?
>
> For instance, if I check http://www.coolgroups.com/desert2/, it says
> there are none.
>
> If I do IHTMLDocument2::get_all, the link is there. Any ideas?
>

Well, the documentation says, "The collection returns only anchor objects
that have a name or id attribute value". All I see on that page is...

<a href = 'desert2.zip'>Download Infinite Desert and full source</a><br>

....which seems to have neither.

--
Jeff Partch [VC++ MVP]


From: bob on
Ok, thanks.

I guess I have to do IHTMLDocument2::get_all to get all the links?

Seems strange, but I see no other way.

From: Igor Tandetnik on
bob(a)coolgroups.com wrote:
> I guess I have to do IHTMLDocument2::get_all to get all the links?

You can use document.links collection, or document.all.tags("a"), or
document.getElementsByTagName("a")
--
With best wishes,
Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925


From: bob on
Great. I used document.getElementsByTagName("a"), and it works well.

Any tips on clicking a button? I'm guessing it might be something with
IHTMLButtonElement, but I'm having trouble figuring it out.