• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 230
  • Last Modified:

Get html source from web browser object

I have a form that is using a web browser object.  After I navigate to the page, how can I get the source code of the loaded page into a variable?
1 Solution
Bob LearnedCommented:
1) Add a .NET reference to Micro$oft.mshtml library
2) Use something like this:

Private Sub AxWebBrowser1_DocumentComplete(ByVal sender As Object, ByVal e As AxSHDocVw.DWebBrowserEvents2_DocumentCompleteEvent) Handles AxWebBrowser1.DocumentComplete
  Dim document As mshtml.HTMLDocument = Me.AxWebBrowser1.Document
End Sub


Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now