Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27348

How to click on a java button using VB 7

$
0
0
I'm trying to run a vb command that will fill in the user ID & password then click on the sign on button. I can get the user id field and password to fill but having a problem with the click on button. Anyone have any suggestions?

Here is my script:
Sub Project()

Dim MyHTML_Element As IHTMLElement
Dim MyURL As String
On Error GoTo Err_Clear
MyURL = "https://website.com"
Set MyBrowser = New InternetExplorer
MyBrowser.Silent = True
MyBrowser.navigate MyURL
MyBrowser.Visible = True
Do
Loop Until MyBrowser.readyState = READYSTATE_COMPLETE
Set HTMLDoc = MyBrowser.Document
HTMLDoc.all.User.Value = "MyUserID"
HTMLDoc.all.Password.Value = "PASS123"

For Each Html_Element In HTMLDoc.getElementsByTagName("signOnButton")
If element.getAttribute("class") = "signOnButton" Then
element.InvokeMember ("onclick")
End If
Next

Err_Clear:
If Err <> 0 Then
Err.Clear
Resume Next
End If
End Sub

Here is the html source for the button from the website I'm trying to log into


<div class="SignOnButton">
<div id="signButton" class="floatLeft" ></div>
<div class="floatRight padding-left-1"><a class="bold" href="/pass/one.fps" >Forgot Password?</a></div>

Viewing all articles
Browse latest Browse all 27348

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>