Here's 1 way to do it inside a VBA Macro. The htmlText
object will contain all the HTML at the end of this sub.
Put a breakpoint before the End Sub
, then add the htmlText
object to Watch Window and you can then see all the data coming back in the Watch Window and decide how you want to extract the html data and where you want to put it in the Excel sheet etc.
Private Sub GetWebsiteHtml_Click()
Dim x As Long, y As Long
Dim htmlText As Object
Set htmlText = CreateObject("htmlFile")
With CreateObject("msxml2.xmlhttp")
.Open "GET", "http://google.com", False
.send
htmlText.body.innerHTML = .responsetext
End With
End Sub