Function PageContents(sURL As String) As String
On Error Resume Next
Dim iz As New InternetExplorer
iz.Navigate sURL
Connect: Do Until iz.Busy = True
DoEvents
Loop
PageContents = CStr(iz.Document.Body.innerhtml)
If Len(PageContents) > 0 Then
Exit Function
Else
GoTo Connect:
End If
End Function
Public Function BetweenHmm(ByVal sFrom As String, ByVal sStart As String, ByVal sEnd As String) As String
Dim BegPos: BegPos = InStr(1, sFrom, sStart, 1)
If BegPos > 0 Then
BegPos = BegPos + Len(sStart)
Dim EndPos: EndPos = InStr(BegPos, sFrom, sEnd, 1)
If EndPos = 0 Then EndPos = InStr(BegPos, sFrom, vbCrLf, 1)
If EndPos = 0 Then EndPos = Len(sFrom) + 1
BetweenHmm = Mid(sFrom, BegPos, EndPos - BegPos)
End If
End Function
|