Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Stripping HTML keeping Text
Message
De
18/11/2010 08:33:52
 
 
À
18/11/2010 02:59:25
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01489477
Message ID:
01489558
Vues:
47
>>>>I'm pulling HTML off the internet and into a string then a memo field. I only want the text. How do I go about cleaning the HTML out of the string?
>>>
>>>Did you try using InnerText property?
>>>Re: Control eh? Thread #1488307 Message #1488318
>>
>>I am no longer using the WEBBR4OWSER41 - It's Tore's code with which I am playing.
>
>Using simple automation:
>
>lcURL='http://www.levelextreme.com'
>lnTime=1200 && 12 seconds
>lox=Createobject('internetexplorer.application')
>lox.Visible=.t.
>lox.Navigate(lcURL)
>lox.Visible=.T.
>Wait 'Navigating!' Window Nowait
>If !NavComplete(lox,lnTime)
>   ??Chr(7)
>   Wait 'Timeout feil!' Window
>   lox.Visible=.F.
>   Release lox
>   Return
>Endif
>Wait Clear
>lcHTML=lox.document.body.innertext
>If !Empty(lcHTML)
>   MessageBox(lcHTML)
>EndIf    
>
>*****************************************************************************
>Function NavComplete
>   Lpara toIE, tnTimeout
>   lnTimeout=Iif( Type("tnTimeout")="N",tnTimeout ,60 )
>   lnTimeElapsed=0
>   lnStartSeconds=Seconds()
>   Do While .T.
>      If toIE.ReadyState=4 And !toIE.Busy
>         Do While .T.
>            If toIE.Document.ReadyState="complete"
>               Return .T.
>            Endif
>            If (Seconds()-lnStartSeconds)>lnTimeout
>               Return .F.
>            Endif
>         Enddo
>      Endif
>      If (Seconds()-lnStartSeconds)>lnTimeout
>         Return .F.
>      Endif
>   Enddo
>Endfunc
Takk Tore. Between your code and Rick's, I think I am over the rough spot in this app.
I ain't skeert of nuttin eh?
Yikes! What was that?
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform