(Solved) – Scraping specific data inside a table

(solved)-–-scraping-specific-data-inside-a-table

This may be a pretty easy solution but I’m at a loss even though I feel close. I’m trying to scrape market data from the TMX website, specifically I would like the dividend amount to drop into my excel workbook. This is the below few lines of code from the “inspect” section.

I need to get $0.0495 into the workbook and my vba code is the following:

For Each htmlELE In ieObj.document.getElementsByClassName("table")(0).getElementsByTagName("tr")(0).getElementsByTagName("td")
    With ActiveSheet
        .Range("L10").Value = htmlELE.Children(0).innerText
    End With

So, I’m moving through the code but the end keeps picking up “Amount:” and dropping it in the cell instead of the value, what I need, sitting on the next line.

Leave a Reply

Your email address will not be published. Required fields are marked *

Amount:  $0.0495