godmajestic
Messages postés1Date d'inscriptionlundi 29 juillet 2002StatutMembreDernière intervention31 juillet 2002
-
31 juil. 2002 à 12:14
thiosyiasar
Messages postés186Date d'inscriptionlundi 11 mars 2002StatutMembreDernière intervention30 novembre 2010
-
31 juil. 2002 à 22:16
je dois realiser un moteur de recherche sur un certain nombre de page et pour cela je dois recuperer leur contenu et le copier ds un fichier qqc mais je dois prealablement netoyer les pages pour ne recuperer que le texte entre balises!
cs_rene38
Messages postés1858Date d'inscriptionsamedi 29 juin 2002StatutMembreDernière intervention17 octobre 201311 31 juil. 2002 à 16:19
Private Sub Command1_Click()
Dim i As Long, j As Long, k As String * 1, Balise As Boolean
Open "FichierHtml.htm" For Binary As #1
Open "FichierTexte.txt" For Binary As #2
Balise = False
For i = 1 To LOF(1)
Do
Get 1, i, k ' lecture des caractères du fichier Html
If k = "<" Then ' début de balise
Balise = True
Exit Do
End If
If k = ">" Then ' fin de balise
Balise = False
Exit Do
End If
If Balise Then Exit Do ' dans la balise
j = j + 1 ' hors balise : récupérer le texte
Put 2, j, k
Exit Do
Loop
Next i
Close
End Sub