I tried to click on the hyperlink
by invokemember("click") but it
does not work maybe because the
hyperlink does not have an ID.
so is there another way to open a
hyperlink if the hyperlink contains
a certain word like "hello" using
webbrser.documenttext.contains and
then if found to open that hyperlink.
thanks in advance.
Open hyperlink in webbrowser visual basic vb.net
Page 1 of 13 Replies - 286 Views - Last Post: 16 January 2013 - 03:12 AM
Replies To: Open hyperlink in webbrowser visual basic vb.net
#2
Re: Open hyperlink in webbrowser visual basic vb.net
Posted 15 January 2013 - 11:47 AM
your best bet would be to get all html eliments and then look for your link like so
Dim all As HtmlElementCollection = WebBrowser1.document.All
For Each wpelement As HtmlElement In all
If wpelement.GetAttribute("value") = "click me" Then
wpelement.InvokeMember("click")
End If
Next
#3
Re: Open hyperlink in webbrowser visual basic vb.net
Posted 15 January 2013 - 03:19 PM
rob2k9, on 15 January 2013 - 11:47 AM, said:
your best bet would be to get all html eliments and then look for your link like so
Dim all As HtmlElementCollection = WebBrowser1.document.All
For Each wpelement As HtmlElement In all
If wpelement.GetAttribute("value") = "click me" Then
wpelement.InvokeMember("click")
End If
Next
Hello, I tried that code you posted but it did not do anything..
#4
Re: Open hyperlink in webbrowser visual basic vb.net
Posted 16 January 2013 - 03:12 AM
ok d you bother to edit it in an way to work for you ? i am guessing not really this is one of the esiest things todo in vb you should try learning and reading more tuts before you even try make an application
you need to change the code around a little bit from what i gave you to work with your link if you cant do that then i am sorry you just shouldnt be working in vb.net and need to read up a bit more on tuts
you need to change the code around a little bit from what i gave you to work with your link if you cant do that then i am sorry you just shouldnt be working in vb.net and need to read up a bit more on tuts
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote



|