Gordon Prince
Gordon Prince

Reputation: 151

IE VBA open web page equal to clicking on first web page link

I'm trying to automate filling in a transaction on a series of web pages using Internet Explorer and MS-Access VBA. I've done quite a bit of this, but am stumped on this one pair of pages. I using code like this:

Set htmlDoc = ie.Document
With htmlDoc
    Set e = .getElementById("j_idt31_data")
    If e Is Nothing Then GoTo FileAppeal_Error
    Set elems = e.getElementsByClassName("ui-widget-content ui-datatable-odd ui-datatable-selectable")
    For Each e In elems
        If InStr(1, e.innerText, "Evans ") > 0 Then
            e.Click
            Exit For
        End If
    Next

End with

I start on this page: https://boe.shelbycountytn.gov/eFile/taxrep.xhtml, click on one of the radio buttons on the left, then click on [Submit], which takes me to https://boe.shelbycountytn.gov/eFile/search.xhtml

But I can't figure out how to programmatically get the [Submit] button to succeed. When I programmatically click on it I get a "Tax Rep is Required" error message.

Suggestions greatly appreciated.

Upvotes: 0

Views: 76

Answers (2)

Gordon Prince
Gordon Prince

Reputation: 151

    Dim elems As MSHTML.IHTMLElementCollection, i As MSHTML.HTMLInputElement        
    Set elems = HTMLDocument.getElementsByClassName("ui-icon-blank")
    Set i = elems(1) 'this gets the second option in the list
    i.Click

Upvotes: 1

QHarr
QHarr

Reputation: 84475

I did this using selenium basic. Download then add the selenium type library reference.

Option Explicit
Public Sub test()
    With New ChromeDriver
         .Start "Chrome"
         .Get "https://boe.shelbycountytn.gov/eFile/taxrep.xhtml"
         .FindElementByCss("span.ui-radiobutton-icon.ui-icon.ui-icon-blank").Click
         .FindElementByCss("span.ui-button-text.ui-c").Click     
    'other code
    Stop
    .Quit
    End With
End Sub

Upvotes: 1

Related Questions