Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

WebBrowser - VB getting text from page
I have a VB6 program which downloads a web page (using VB6 WebBrowser) and
needs to get the text from the page.

I have looked at the WebBrowser structure, and found the text from the page
in several parts of the structure. I therefore decided to use
'wb1.Document.body.InnerText' ...

p = InStr ( wb1.Document.body.InnerText, str)

Is this the correct / best way to access the web page datwa? Will this work
an client machine which have different versions of IE?

Any  help appreciated.

thanks

Garry



Report this thread to moderator Post Follow-up to this message
Old Post
Garry
12-30-04 01:55 AM


Re: WebBrowser - VB getting text from page
The Inet control is easier and quicker for this purpose. Unlike the
WebBrowser, Inet doesn't render the page; it just retrieves it.

pText = Inet.OpenURL(http://www.....)



"Garry" <newsgroup@questinfo.com> wrote in message
news:41d33b96$0$23006$cc9e4d1f@news.dial.pipex.com...
> I have a VB6 program which downloads a web page (using VB6 WebBrowser) and
> needs to get the text from the page.
>
> I have looked at the WebBrowser structure, and found the text from the
page
> in several parts of the structure. I therefore decided to use
> 'wb1.Document.body.InnerText' ...
>
>     p = InStr ( wb1.Document.body.InnerText, str)
>
> Is this the correct / best way to access the web page datwa? Will this
work
> an client machine which have different versions of IE?
>
> Any  help appreciated.
>
> thanks
>
> Garry
>
>



Report this thread to moderator Post Follow-up to this message
Old Post
Jezebel
12-30-04 01:55 AM


Re: WebBrowser - VB getting text from page
Jezebel

thanks for the Inet suggestion. How do I detect if it failed to get the
page - does it return Null or "" ?

Garry


"Jezebel" <madbastard@whitehouse.gov> wrote in message
news:u9guwAg7EHA.824@TK2MSFTNGP11.phx.gbl...
> The Inet control is easier and quicker for this purpose. Unlike the
> WebBrowser, Inet doesn't render the page; it just retrieves it.
>
> pText = Inet.OpenURL(http://www.....)
>
>
>
> "Garry" <newsgroup@questinfo.com> wrote in message
> news:41d33b96$0$23006$cc9e4d1f@news.dial.pipex.com... 
and 
> page 
> work 
>
>



Report this thread to moderator Post Follow-up to this message
Old Post
Garry
12-30-04 01:55 AM


Re: WebBrowser - VB getting text from page
Why not test it? Put in a wrong URL and see what happens...



"Garry" <newsgroup@questinfo.com> wrote in message
news:41d3450c$0$12227$cc9e4d1f@news.dial.pipex.com...
> Jezebel
>
> thanks for the Inet suggestion. How do I detect if it failed to get the
> page - does it return Null or "" ?
>
> Garry
>
>
> "Jezebel" <madbastard@whitehouse.gov> wrote in message
> news:u9guwAg7EHA.824@TK2MSFTNGP11.phx.gbl... 
> and 
>
>



Report this thread to moderator Post Follow-up to this message
Old Post
Jezebel
12-30-04 08:55 AM


Re: WebBrowser - VB getting text from page
Look into the State Event to determine the status of a page 'loading'.

You could also use something like (air-code)

Inet.URL http://www.
Inet.Execute ,"GET"

Private Sub Inet_StateChanged(State as Long)

If State = 12 Then
'Get the page using the GetChunk method of the Inet control
End If

End Sub

--
Chris Hanscom - Microsoft MVP (VB)
Veign's Resource Center
http://www.veign.com/vrc_main.asp
--

"Garry" <newsgroup@questinfo.com> wrote in message
news:41d3450c$0$12227$cc9e4d1f@news.dial.pipex.com...
> Jezebel
>
> thanks for the Inet suggestion. How do I detect if it failed to get the
> page - does it return Null or "" ?
>
> Garry
>
>
> "Jezebel" <madbastard@whitehouse.gov> wrote in message
> news:u9guwAg7EHA.824@TK2MSFTNGP11.phx.gbl... 
> and 
>
>



Report this thread to moderator Post Follow-up to this message
Old Post
Veign
12-30-04 08:55 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Visual Basic archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 03:56 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.