I am interested in using Microsoft WebBrowser Control. Where can I find some useful and relatively complete tutorial?
One specific question: If there is a web link in the page like:
<code>
<a href="http://links.10026.com/?link=" onClick="set('ABC'); return false;">Text</a>
</code>
how can my program get a reference to this link and simulate a click on this link?
Thanks.
> I am interested in using Microsoft WebBrowser Control.
> Where can I find some useful and relatively complete tutorial?
I guess you should find tutorials with Google. As for reference stuff, the MSDN site is a good place for MS related technology. Here is the home page for the WebBrowser control:http://msdn.microsoft.com/library/default.asp?url=/workshop/browser/webbrowser/browser_control_node_entry.asp
> how can my program get a reference to this link and simulate a click on this link?
You need a reference to the html element through the DOM (document.getElementById is the corresponding statement in a browser script).
Hope this helps. -LV
thanks for the reply.
the problem with the link that I mentioned above is that it doesn'thave an ID. Actually I am able to get the collection of all the linksin the webpage, but still I need a way to identify each link.
> the problem with the link that I mentioned above is that it doesn't have an ID.
> Actually I am able to get the collection of all the links in the webpage, but still I need a way to identify each link.
I guess in this case you have to implement your custom element-find logic. That is, getting a reference to some (possibly near) parent element, then looping some subcollection until "finding" the needed element. You have to base this "find" logic on the attributes actually defined in the page. From the small fragment you give, i guess theinnerHTML property is a good candidate here...
Hope this helps and good luck. :) -LV
Thanks for the suggesion. I will try all these properties and hopefully can find a way out.
0 comments:
Post a Comment