首页 > 解决方案 > 通过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>

我在这个网站上尝试了许多不同的代码来让我的 VBA 点击网页上的按钮,但我一直失败,使用此代码成功填写了用户名和密码,但我不知道如何点击继续按钮,这是使用的代码

标签: htmlexcelvbawebcontinue

解决方案


推荐阅读