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

VB.net webpage element help

Discussion in 'Visual Basic .NET' started by DislikeBot, Dec 24, 2012.

  1. DislikeBot

    DislikeBot Newbie

    Joined:
    Dec 22, 2012
    Messages:
    1
    Likes Received:
    0
    Right say you have a webpage with 100 buttons all with the same value, id, class name etc how would you click the 4th

    Its probably very simple but could you use something like for each and count until the 4th

    Thanks in advance.
     
  2. Primeval

    Primeval Newbie

    Joined:
    Dec 9, 2012
    Messages:
    23
    Likes Received:
    0
    Do they have the same "name"?
     
  3. DarkPixel

    DarkPixel Jr. VIP Jr. VIP Premium Member

    Joined:
    Oct 4, 2011
    Messages:
    1,328
    Likes Received:
    1,239
    Location:
    ↓↓↓↓
    Home Page:
    That's actually not possible (at least I don't think it is). They should have at least some small differences (ids,classes) or else all the buttons would do the same thing.
    Again that's just my opinion. I could be wrong.
     
  4. Psychop1

    Psychop1 Registered Member

    Joined:
    Jul 30, 2010
    Messages:
    63
    Likes Received:
    19
    This is possible. Just put the elements in a collection, and modify the element at whichever index value you want. For example, assume you declared your element collection as "elements", and you wanted to use the fourth element, it would be something like elements(3).Invokemember("click").