I am trying to build a macro to web scrape the status of a Cargo Shipment based on the shipment number. I am using the XML-HTTP method but I am new to VBA web scraping. I have tried to get the value by using the GetValuebyID,Tag, Class with no success.
The highlighted line is the one I need the value extracted from. [Need to Extract the 10 of 10 Delivered Value][1]
This is how far I have gotten with the code.
Sub FlightStat()
Dim XMLReq As New MSXML2.XMLHTTP60
Dim HTMLDoc As New MSHTML.HTMLDocument
Dim AllTables As IHTMLElementCollection
Dim MainTable As IHTMLTable
XMLReq.Open "GET", "https://www.unitedcargo.com/OurNetwork/TrackingCargo1512/Tracking.jsp?id=10205436&pfx=016", False
XMLReq.send
If XMLReq.Status <> 200 Then
MsgBox "Problem" & vbNewLine & XMLReq.Status & " - " & XMLReq.statusText
Exit Sub
End If
HTMLDoc.body.innerHTML = XMLReq.responseText
Set AllTables = HTMLDoc.getElementsByTagID("dispTable0")
End Sub
I would be grateful if someone could help me get the "10 of 10 Delivered" value extracted [1]: https://i.stack.imgur.com/xcOAZ.png