How to click on a link
-
Hi All I am using a WebBrowser control to navigate to sites in my VB.Net application. After navigating I want to Navigate to some of the links in it depending on some conditions. Can anybody advise how can I collect the links contained in the WebBrowser Document and how can I Raise a click event for a collected link so that it automatically navigates to the link. I have written the code as bellow : Dim link1 As mshtml.HTMLLinkElement link1 = WebBrowser1.Document.Links(10) Now How can I click the link link1 to navigate to the link. Please Help. Thanks in advance.
-
Hi All I am using a WebBrowser control to navigate to sites in my VB.Net application. After navigating I want to Navigate to some of the links in it depending on some conditions. Can anybody advise how can I collect the links contained in the WebBrowser Document and how can I Raise a click event for a collected link so that it automatically navigates to the link. I have written the code as bellow : Dim link1 As mshtml.HTMLLinkElement link1 = WebBrowser1.Document.Links(10) Now How can I click the link link1 to navigate to the link. Please Help. Thanks in advance.
Hi, On the Webrowser's click event try link1.Navigate(URLstring). Hope this helps.
Regards, John Adams ComponentOne LLC
-
Hi, On the Webrowser's click event try link1.Navigate(URLstring). Hope this helps.
Regards, John Adams ComponentOne LLC
Thanks Adams for your response. My problem is when I assign the link in the line link1 = WebBrowser1.Document.link(10) it doesn't produce any output and the immediate line after this line also doen't gets executed. I think some errors occur in this line and the compiler is not able to track it. for which the focus goes to the exe after this line gets executed. If you can help me out in solving the problem, it will be a great help. Thanks in advance.
Sekhar :)