mardi 11 mai 2021

click submit button in web page through vba

Sub j()
Dim ie As Object
Dim doa As HTMLDocument
Dim HTMLdoc As HTMLDocument
Dim button As HTMLInputButtonElement
Dim i As Integer
'Set HTMLdoc = .document
Set ie = CreateObject("internetexplorer.application")

ie.Visible = True
ie.navigate "https://ebfpm.tsgwn.co.in/Prksoortal/login.jsp"

Do While ie.busy
 Application.Wait DateAdd("s", 1, Now)
Loop
'Set doa = ie.document
ie.document.getelementbyid("username").Value = "egh125"
ie.document.getelementbyid("password").Value = "**"

End Sub

'in web page the "continue" button code which i try to click is

<a class="button ok" tabindex="0" href="javascript:submitForm();">
<span class="submit-text">Continue</span>
<img class="arrow" src="img/arrow.png" alt="">
</a>

I have tried numerous variations of codes on this site to get my VBA to click on a button on a webpage ,but all the time i failed , Username & password was successfully filled using this code but i cant figure out how to click the Continue button, this is the code which is used




Aucun commentaire:

Enregistrer un commentaire