(Solved) – Trying to Scrape Freddie Mac Website using VBA

  • by
(solved)-–-trying-to-scrape-freddie-mac-website-using-vba

“I am trying to get the data attributes from the following website: https://freddiemac.mbs-securities.com/freddie/details/31334W2C4

Sub Data_Pull()

    Dim XMLPage As New MSXML2.XMLHTTP60
    Dim HTML As New MSHTML.HTMLDocument

    XMLPage.Open "Get", "https://freddiemac.mbs-securities.com/freddie/details/31334W2C4", False
    XMLPage.send

    HTML.body.innerHTML = XMLPage.responseText

    net_interest_rate = HTML.getElementsByClassName("list-group-item")(2).innerText

    Sheet1.Cells(1, 1) = net_interest_rate


End Sub

Leave a Reply

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