shahin
Active Member
How to get the "URL" address back using xmlhttp request? I did it with IE and found the URL back successfully but in case of sending the request with xmlhttp I get a blank URL. How can I achieve that?
Using IE:
The result I get is:
However, using xmlhttp requests:
Result:
To be clearer: I expect to get the same url back as a result using xmlhttp request.
Using IE:
Code:
Sub fetch_url()
Dim IE As New InternetExplorer, html As New HTMLDocument
With IE
.Visible = False
.navigate "https://chandoo.org/forum/forums/vba-macros/"
Do While IE.readyState <> READYSTATE_COMPLETE: Loop
Set html = .document
End With
MsgBox html.URL
IE.Quit
End Sub
The result I get is:
Code:
https://chandoo.org/forum/forums/vba-macros/
However, using xmlhttp requests:
Code:
Sub WebData()
Dim http As New XMLHTTP60, html As New HTMLDocument
Dim source As Object
With http
.Open "GET", "https://chandoo.org/forum/forums/vba-macros/", False
.send
html.body.innerHTML = .responseText
End With
MsgBox html.URL
End Sub
Result:
Code:
about:blank
To be clearer: I expect to get the same url back as a result using xmlhttp request.