VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



View Source Webbrowser

by Juha s�derqvist (4 Submissions)
Category: Internet/HTML
Compatability: Visual Basic 3.0
Difficulty: Intermediate
Date Added: Wed 3rd February 2021
Rating: (6 Votes)

View source - using webbrowser control.
No need of those msinet.ocx which all people always tell to use to get source of HTML-page.
This is a simple and beatiful way to do it.
PS..another even smart way is to add a webbrowser2.visible = false and to change viewsource function to use the hidden one.. instead of the webbrowser1 (which you may use to navigate pages) ; )

Code Returns
Source of webpage, opens notepad and if html-source is too big automaticly opens wordpad !!

Rate View Source Webbrowser

' a sub to be called from example webbrowser 
' mnuviewsource
' webbrowser1 = webbrowser control
' combo1 = used as an addressbar
private sub viewsource
On Error Resume Next
If Combo1.Text <> "" Then
me.WebBrowser1.Navigate "view-source:" & Me.WebBrowser1.LocationURL 'view source 
  else
'nothing here
  End If
end sub

Download this snippet    Add to My Saved Code

View Source Webbrowser Comments

No comments have been posted about View Source Webbrowser. Why not be the first to post a comment about View Source Webbrowser.

Post your comment

Subject:
Message:
0/1000 characters