text from HTML 
Author Message
 text from HTML

Is there a vb-way to save an html doc as text in order to extract the text
from the page?


Sun, 24 Feb 2002 03:00:00 GMT  
 text from HTML
Take a look at the "OpenUrl" command in the "Internet Transfer Control"
Open help on OpenUrl and you get info on how to save the file.

Warning:
The OpenUrl command in the OCX does not close the handle to Wininet.dll
this may cause Dr Watson to give "Error code 87" on WinNT when closing the
app.

Use the following API call before ending your app.

Private Declare Function InternetCloseHandle Lib "wininet.dll" (ByVal hInet
As Long) As Long

---------> PoorSucker



Quote:
> Is there a vb-way to save an html doc as text in order to extract the text
> from the page?



Sun, 24 Feb 2002 03:00:00 GMT  
 text from HTML
You could use this ...

Public Function StripHtml(sText)

Dim is_tag, write2file, i

         For i = 1 To Len(sText)
            DoEvents
            Select Case Mid$(sText, i, 1)
               Case "<"
                  is_tag = True
               Case ">"
                  is_tag = False
               Case Else
                  If Not is_tag Then write2file = write2file & Mid$(sText,
i, 1)
            End Select
        DoEvents
         Next
StripHtml = write2file
End Function

Quote:

>Is there a vb-way to save an html doc as text in order to extract the text
>from the page?



Sun, 24 Feb 2002 03:00:00 GMT  
 text from HTML
Use Webbrowser, walk the DOM,
use .innertext of interesting parts
(.body for example).

HTH

Thomas


Quote:
>You could use this ...

>Public Function StripHtml(sText)

>Dim is_tag, write2file, i

>         For i = 1 To Len(sText)
>            DoEvents
>            Select Case Mid$(sText, i, 1)
>               Case "<"
>                  is_tag = True
>               Case ">"
>                  is_tag = False
>               Case Else
>                  If Not is_tag Then write2file = write2file & Mid$(sText,
>i, 1)
>            End Select
>        DoEvents
>         Next
>StripHtml = write2file
>End Function




- Show quoted text -

Quote:
>>Is there a vb-way to save an html doc as text in order to extract the text
>>from the page?



Mon, 25 Feb 2002 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Reply to plain text with HTML and correct auto signature OL2002

2. How to detect if a new mail is of plain text or html

3. Plain text vs HTML from Outlook automation

4. more forms blues - plain text not HTML?

5. Creating a new text or HTML message and using Word as an editor

6. text to HTML

7. Converting Rich Text to HTML

8. Converting Text to HTML

9. source text of HTML page

10. Entering text into HTML form fields with VB

11. Text to HTML

12. Rich text to HTML

 

 
Powered by phpBB® Forum Software