Clicking buttons on HTML

Discussion in 'Programming General' started by Cody, Aug 31, 2008.

Clicking buttons on HTML
  1. Unread #1 - Aug 31, 2008 at 11:00 PM
  2. Cody
    Joined:
    May 10, 2005
    Posts:
    3,052
    Referrals:
    5
    Sythe Gold:
    30

    Cody Grand Master
    Visual Basic Programmers

    Clicking buttons on HTML

    Anyone know how to click buttons on a website

    Standard HTML button..

    It has to find the button then click it not use xy..
     
  3. Unread #2 - Aug 31, 2008 at 11:09 PM
  4. Jazz00006
    Joined:
    Aug 26, 2005
    Posts:
    807
    Referrals:
    0
    Sythe Gold:
    0

    Jazz00006 Apprentice
    Visual Basic Programmers

    Clicking buttons on HTML

    Using the webbrowser control you can use:
    Code:
    WebBrowser1.Document.All("submitBtn").Click
    Some are iffy and require
    Code:
    WebBrowser1.Document.All("submitBtn").Submit
    Replace "submitBtn" with the Name of the button you wish to click
     
  5. Unread #3 - Sep 1, 2008 at 8:18 AM
  6. Nullware
    Joined:
    Jan 30, 2007
    Posts:
    1,761
    Referrals:
    4
    Sythe Gold:
    0

    Nullware Guru

    Clicking buttons on HTML

    If you don't want to have to change it based on the name of the submit button this has worked for me. I found it somewhere so I don't take credit for writing it.
    Code:
    For j = 0 To WebBrowser1.Document.Forms(0).length - 1
      
      If WebBrowser1.Document.Forms(0)(j).Type = "submit" Then
        WebBrowser1.Document.Forms(0)(j).Click
        Accounts = Accounts + 1
      End If
    Next j
     
< Login Form To Create A New Button | Sythe Login Program? >

Users viewing this thread
1 guest


 
 
Adblock breaks this site