0

I am trying to fetch the html table data using vba, HTML table contains search box based on search box input, table will filter the rows. But my code fetching first row of not filtered table data

Html code

enter image description here vba code

Set div_tag = ie.document.getElementById("list-wrapper")
        Set Table = div_tag.getElementsByTagName("TABLE") 'Table
         Set tRows = Table(0).getElementsByTagName("tr")




 For lngTable = 0 To Table.Length - 1
        For lngRow = 2 To tRows.Length - 1
        'For lngCol = 0 To Table(0)(lngTable).Rows(lngRow).Cells.Length - 1

            Set tCells = tRows(lngRow).getElementsByTagName("td") '.Item(2)
            MsgBox (tCells.Item(2).innerText & "....." & tCells.Item(7).innerText & "....")
           'Next lngCol

        Next lngRow
       ' ActRw = ActRw + objTable(lngTable).Rows.Length + 1
    Next lngTable

looking for solution

Thanks...

2
  • Is there an URL to go with this you can provide? And maybe explain a little more the expected result. I am pretty certain this is not a duplicate of the linked question as you are attempting to interact with the page and then grab the table of filtered results. The linked question is after a single value from an existing table. Neither given answer there will do what you are after. Commented Oct 10, 2018 at 6:22
  • Please include HTML using the snippet tool available via edit and are the rows currently shown in the image the ones you are after? Commented Oct 10, 2018 at 6:37

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.