1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How i can click on WEBBROWSER LINK LABEL using vb.net

Discussion in 'Visual Basic .NET' started by Andrew1399, Mar 11, 2015.

  1. Andrew1399

    Andrew1399 Newbie

    Joined:
    Feb 28, 2015
    Messages:
    4
    Likes Received:
    0
    Code:
    <span class="label-pedido" id="label-pedido-20489948">Exibir</span>
    this is code that i want to click, more this "20489948" all time change... what code i can do to click this?
    this is linklabel image DnHoQQC.png

    thanks alot.
     
  2. ultra.marine

    ultra.marine Registered Member

    Joined:
    Oct 5, 2012
    Messages:
    80
    Likes Received:
    104
    Location:
    Macedonia
    emm something like this (note that I am writing it in the editor it could have some minor name errors)

    Dim htmlelements as htmlelementcollection = WebBrowserXXX.getElementsByTagName("span")
    Dim element as htmlelement
    For each element in htmlelements
    try

    if element.outterhtml.tostring.contains("id=""label-peido") and element.innertext.contains("exibir")
    element.focus()
    element.invokemember("click") 'here click happens
    end if
    catch
    end try

    next
     
  3. AmateRasu

    AmateRasu Power Member

    Joined:
    Nov 12, 2013
    Messages:
    763
    Likes Received:
    429
    Location:
    Manila,Philippines
    ^ use that one but don't forget to use try catch ;)