I am trying to create a function that tracks the status of a cargo Airway Bill. I have created the following function with the help of SO community. I am not too familiar with HTML. I did trial and error with a couple of other airlines with GetElementby Tag/ID, etc and it worked.
However, for this particular airline, there is no Class name, tag name or id.
I cannot figure out how to get the highlighted value (the value needed will be the value in the top row but the same column every time) in the attached image
.
Can someone please help me how to pull that "Received" value in the table.
Function written that work's for the most part Sample Cargo Number for testing - 59473805
Function FlightStat_VA(cargoNo As Variant) As String
Const Url = "https://www.virginatlanticcargo.com/gb/en/track/track-your-cargo.html?prefix=932&number="
Dim dStatCheck$, deliveryStat$, S$
With CreateObject("MSXML2.XMLHTTP")
.Open "GET", Url & cargoNo & "&track=go", False
.send
S = .responseText
End With
With CreateObject("HTMLFile")
.write S
On Error Resume Next
'Need Help Here
dStatCheck = UCase(.getElementById("...").getElementsByTagName("...")(0).innerText)
On Error GoTo 0
If dStatCheck <> "" Then
deliveryStat = dStatCheck
Else
deliveryStat = "Not Found"
End If
End With
FlightStat_VA = deliveryStat
End Function
deliveryStat