Fill user name and password in a webpage using VBA

前端 未结 1 984
无人共我
无人共我 2020-12-01 15:28

This is my first try to navigate a IE browser through VBA. I am trying to: - go to this webpage https://hb2.bankleumi.co.il/e/Login.html - fill in the username - fill

相关标签:
1条回答
  • 2020-12-01 16:18

    Try this

    Sub test()
    ' open IE, navigate to the desired page and loop until fully loaded
        Set ie = CreateObject("InternetExplorer.Application")
        my_url = "https://hb2.bankleumi.co.il/e/Login.html"
    
        With ie
            .Visible = True
            .Navigate my_url
            .Top = 50
            .Left = 530
            .Height = 400
            .Width = 400
    
        Do Until Not ie.Busy And ie.readyState = 4
            DoEvents
        Loop
    
        End With
    
    ' Input the userid and password
        ie.Document.getElementById("uid").Value = "testID"
        ie.Document.getElementById("password").Value = "testPW"
    
    ' Click the "Search" button
        ie.Document.getElementById("enter").Click
    
        Do Until Not ie.Busy And ie.readyState = 4
            DoEvents
        Loop
    End Sub
    
    0 讨论(0)
提交回复
热议问题