Using VBA after Internet Exploer goes away, how to receive web page text

Michael Kaplan 6 Reputation points

After IE goes away I still need using VBA to be able to request a web page and receive the retuned contents.
Here is a test call i put together for this forum:
The main thing is to be able to use some browser after IE goes away and to be able to receive the output from the website.
Thanks ahead of time for any help.

  • Mike -

Sub testcall()
Dim http As Object
Dim JSON As Object
Dim IE As Object
Dim IE_URL As String

Set IE = CreateObject("InternetExplorer.Application")
With IE
    .Visible = True
    IE_URL = ""
    .Navigate IE_URL, 14, "_self", Null ', header2
    Do Until .readyState = 4: Application.Wait (Now + TimeValue("0:00:01")): Loop
    Debug.Print .document.body.innerText
  '  Set oJson = ParseJSONx(.document.body.innerText)
End With

End Sub

0 comments No comments
{count} vote

2 answers

Sort by: Most helpful
  1. Viorel 114.7K Reputation points

    Check an alternative:

    Dim x
    Set x = CreateObject("MSXML2.XMLHTTP")
    x.Open "GET", "http://. . . .", False
    Dim result As String
    result = x.responseText
    0 comments No comments

  2. Pro Gamer 0 Reputation points

    This gonna work;

    Set IE = WScript.CreateObject("InternetExplorer.Application", "IE_")
    IE.Navigate "
    IE.Visible = True
    'Wait til DOM is ready
    Do Until IE.ReadyState = 4 : Loop
    If IsObject(IE.Document.GetElementById("nav-tags")) Then
    End If
    Set IE = Nothing
    0 comments No comments