Navigate

Downloads a certain page source into a variable, full content in HTML, using Internet Explorer

CodeFunctionName
What is this?

Public

Tested

Original Work
Public Function Navigate(sURL As String, sPostData As String) As String
Dim HttpReq As MSXML2.XMLHTTP, Errcount
Set HttpReq = New MSXML2.XMLHTTP
On Error Resume Next
' HttpReq.Open "POST", sURL, True' toggle the use of these lines if did not work
HttpReq.Open "GET", sURL, True
DoEvents
HttpReq.send sPostData
Do1:
DoEvents
Navigate = HttpReq.responseText
DoEvents
If HttpReq.readyState = 4 Then
Navigate = HttpReq.responseText
DoEvents
Else
DoEvents
GoTo Do1
End If
GoTo ByeBye
Err11:
'Errcount = Errcount + 1
'If Errcount > 10 Then GoTo ByeBye
'Set HttpReq = Nothing
'DoEvents
'Err.Clear
'ReadSStatus
GoTo ByeBye
ByeBye:
Set HttpReq = Nothing
End Function

sURL, sPostData

Views 7,131

Downloads 1,639

CodeID
DB ID

ANmarAmdeen
606
Attachments
Revisions

v2.0

Thursday
September
27
2018