Hi.
It would help to know: (1) specifically, what it is you need help with; and (2) when you have code only "partially works", if you could explain which part of it is working and which part is not.
Just looking at it, I'm not quite sure how you get the remaining ink values from the innerText property. From the HTML code you've posted, it seems almost as though the height attribute of the IMG tag might give the necessary information. Assuming that this is the case, I tried to access the height attribute values, but for whatever reason it just wasn't working, so I gave up and decided that the quicker and simpler route would just be to run a regular expression over the text.
The code below will do that - you just need to decide how you want to put the html code into the HTMLCode variable. The results will be assigned to each of the corresponding variables (Black, Cyan, Magenta, Yellow, Waste). Hope that helps.
Sub GetData()
Dim Results As Object
Dim HTMLCode As String
Dim RegEx As Object
Dim RoomNo As Long
Dim IPAddress As String
Dim Black As Long
Dim Cyan As Long
Dim Magenta As Long
Dim Yellow As Long
Dim Waste As Long
Set RegEx = CreateObject("VBScript.RegExp")
' RoomNo = INSERTROOMNO
' IPAddress = INSERTIPADDRESS
HTMLCode = INSERTCODE
With RegEx
.Pattern = "\<img class=\'color\' src=\'\.\.\/\.\.\/IMAGE\/Ink_(\w{1,5})\.PNG\' height=\'(\d{1,3})\'"
.MultiLine = False
.Global = True
.ignorecase = True
If .test(HTMLCode) Then
Set Results = .Execute(HTMLCode)
Black = CLng(Results(0).Submatches(1))
Cyan = CLng(Results(1).Submatches(1))
Magenta = CLng(Results(2).Submatches(1))
Yellow = CLng(Results(3).Submatches(1))
Waste = CLng(Results(4).Submatches(1))
End If
End With
Dim ws As Worksheet
Set ws = ThisWorkbook.Worksheets("Sheet1")
' INSERT CODE TO WRITE THE RESULTS TO THE WORKSHEET
End Sub