Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get WebBrowser page HTML code

Status
Not open for further replies.

JimPeplinski

Programmer
Joined
Jun 1, 2004
Messages
2
Location
CA
I need to retrieve the HTML source code display in my VB6 application in a webBrowser object

is there a way to get the html source code and then put it in a variable.

I could go also with saving the web page on my hardrive and then open it with a filestream or something.

Reason is i need to parse the page to get an URL.

Thanx
 
got it,

this can be achieve easely with the Inet object

strUrl = Inet1.OpenURL(
this will retrieve the html content of any web page

wish i found that earlier...;--)
 

strVar = webBrowser.Document.DocumentElement.innerHTML
 
Yeah, and if it is in PROPPER FORMAT you can use an XML parser to parse it... such as DOM

propper meaning every tag having an end tag...

like a line break is <br>

but a propper break is <br/>

if you (or they) use <br> instead of the <br/> and it does not find a </br> after it, it will not parse (at least not correctly)

although, you could do something like:
strVar = Replace(strVar, "<br>", "<br/>")
to fix the problem, but that might get even more complicated... (Due to variations of the case <br> <Br> <bR> <BR>)


Have Fun, Be Young... Code BASIC
-Josh
cubee101.gif


PROGRAMMER: (n) Red-eyed, mumbling mammal capable of conversing with inanimate objects.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top