We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now

x

Get HTML from Webbrowser control in VB6

Kingaroo
Kingaroo asked
on
Medium Priority
764 Views
Last Modified: 2013-12-25
I'm sure this has been asked plenty of times, but how can I get the HTML from a page opened in the webbrowser control in VB6? And I need it as a variable, not opened in notepad or something.
Comment
Watch Question

Ryan ChongSoftware Tead Lead / Business Analyst / System Analyst / Data Engineer
CERTIFIED EXPERT

Commented:
try this maybe:

WebBrowser1.Document.documentElement.Outerhtml
CERTIFIED EXPERT
Commented:
Dim WithEvents Web1 As InternetExplorer
Dim strHtml As String
Dim blnComp As Boolean

Private Sub Form_Load()
Set Web1 = New InternetExplorer
Web1.Navigate "www.experts-exchange.com"
Do While blnComp = False
  DoEvents
Loop
strHtml = Web1.Document.body.innerHTML ' contains the html of the page

End Sub


Private Sub Web1_DocumentComplete(ByVal pDisp As Object, url As Variant)
 blnComp = True
End Sub

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
hes
CERTIFIED EXPERT

Commented:
Mine suggestion has worked for a long time :)
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.