I'm updating an old project where we download an html file and extract information from it. Below is the old code. What I need to do is search for a particular html string that is a unique occurence in the text, then extract from the file, for example, the next 6 characters to the right of the string. Can anyone tell me a simple way to do this? I don't completely understand the old code and wouldn't mind understanding what's going on there either. Thanks.
Code:
Public Function Get_Hour(text As String) As String
Searchstr = "<td class=""cell""><font SIZE=""-1"">Hour</font></td>"
position = InStr(text, Searchstr) + Len(Searchstr)
position = InStr(position, text, "<td class=""cell""><font SIZE=""-1"">Header1</font></td>") + 50
position = InStr(position, text, "<td class=""cell""><font SIZE=""-1""><b>") + 36
Get_Hour = Mid$(text, position, 5)
End Function
Public Function Get_Date(text As String) As String
Searchstr = "<td class=""cell""><font SIZE=""-1"">Date</font></td>"
position = InStr(text, Searchstr) + Len(Searchstr)
position = InStr(position, text, "<td class=""cell""><font SIZE=""-1"">") + 34
position = InStr(position, text, "<td class=""cell""><font SIZE=""-1"">") + 37
position2 = InStr(position, text, "</b></font></td>")
Searchstr = Left$(text, position2 - 1)
Get_Date = Right$(Searchstr, 10)
End Function