Results 1 to 8 of 8

VBA to Pull Data from Log in Website

Threaded View

rlee12 VBA to Pull Data from Log in... 03-02-2013, 08:45 AM
AKK9 Re: VBA to Pull Data from Log... 03-02-2013, 10:15 AM
rlee12 Re: VBA to Pull Data from Log... 03-02-2013, 09:15 PM
AKK9 Re: VBA to Pull Data from Log... 03-02-2013, 09:35 PM
rlee12 Re: VBA to Pull Data from Log... 03-03-2013, 08:43 AM
AKK9 Re: VBA to Pull Data from Log... 03-04-2013, 06:42 AM
rlee12 Re: VBA to Pull Data from Log... 03-04-2013, 10:44 PM
AKK9 Re: VBA to Pull Data from Log... 03-09-2013, 10:31 AM
  1. #6
    Registered User
    Join Date
    01-19-2009
    Location
    UK
    MS-Off Ver
    2007
    Posts
    60

    Re: VBA to Pull Data from Log in Website

    Yeah, looks like you have the wrong id. You're looking for the "input" (buttons/textboxes) and "select" (dropdowns) elements to manipulate.

    Ok, so I've changed the code which will allow you to make your dropdown selections and type in your Access ID and submit the form, but, this opens a new window where you enter your password. So I had to add some code which finds the new window and then lets you enter your password and submit that. I'm using Windows 7 and Internet Explorer 10 and this works for me, but I think it you're might behave differently based on your Windows/Internet Explorer version.

    Try it out, if it fails let me know your Windows and Internet Explorer version.

    Sub Test_1()
    
    Dim oBrowser As New InternetExplorer
    Dim oCollection As IHTMLElementCollection
    Dim oDoc As HTMLDocument
    Dim oSWindows As New ShellWindows
        
        'Open browser, load page and set HTML document
        With oBrowser
            .Visible = True
            .Silent = True
            .navigate "https://www.scbtonline.com"
            Do While .readyState <> 4
            Loop
            Set oDoc = .document
        End With
        
        
        With oDoc
            .getElementById("ddlService").setAttribute "value", "personal" 'Select service (options below)
                'personal" - Online Banking
                'business" - Business Link
                'billpay - Business BillPay
                'creditcards - Credit Cards
                'brokerage - Brokerage Account
                'assetTrust - Asset Mgt Acct
                'remoteRemote - Deposit Capture
        
            .getElementById("PersonalDestination").setAttribute "value", "SUMMARY" 'Select page (options below)
                'SUMMARY - Summary Page
                'EXPRESSXFR - Express Transfer
                'PRIMARYACCTSUMMARY - Primary Account
                'STOPPAY - Stop Payment
                'OPTIONS - Options
                'NICKNAMES - Change Nicknames
                'SEARCH - Transaction Search
                'EXPORT - Transaction Export
        
            .getElementById("AccessIDVisible").setAttribute "value", "PutYourIDHere" 'Enter Access ID
            .getElementsByClassName("secureloginbtn").Item(0).Click 'Submit
        End With
        
        'Close current tab
        oBrowser.Quit
        Application.Wait Now() + TimeValue("00:00:05")
        
        'Find new window
        For Each oBrowser In oSWindows
            Do While oBrowser.readyState <> 4
            Loop
            If Left(oBrowser.document.URL, 35) = "https://web3.secureinternetbank.com" Then
                Exit For
            End If
        Next oBrowser
        Set oDoc = oBrowser.document
        
        'Type password and submit
        With oDoc
            .getElementById("Password").setAttribute "value", "PutYourPasswordHere" 'Password
            .getElementById("submit1").Click 'Submit
        End With
    
    End Sub
    Last edited by AKK9; 03-09-2013 at 10:20 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1