3 Replies - 897 Views - Last Post: 16 January 2013 - 03:12 AM Rate Topic: -----

#1 tmarry83  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 15-January 13

Open hyperlink in webbrowser visual basic vb.net

Posted 15 January 2013 - 11:32 AM

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.
Is This A Good Question/Topic? 0
  • +

Replies To: Open hyperlink in webbrowser visual basic vb.net

#2 rob2k9  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 7
  • Joined: 15-January 13

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


Was This Post Helpful? 0
  • +
  • -

#3 tmarry83  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 15-January 13

Re: Open hyperlink in webbrowser visual basic vb.net

Posted 15 January 2013 - 03:19 PM

View Postrob2k9, 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..
Was This Post Helpful? 0
  • +
  • -

#4 rob2k9  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 7
  • Joined: 15-January 13

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
Was This Post Helpful? 1
  • +
  • -

Page 1 of 1