Extraire un lien web

koutb Messages postés 21 Date d'inscription mercredi 2 avril 2003 Statut Membre Dernière intervention 17 mai 2008 - 8 oct. 2006 à 03:23
cs_Nurgle Messages postés 1642 Date d'inscription samedi 6 novembre 2004 Statut Membre Dernière intervention 28 avril 2011 - 8 oct. 2006 à 10:39
Bonjour,
je voudrai extraire apartir d'une page html que les liens web et je sais pas comment faire?
voila mon petit code incomplet, merci d'avance

Dim HttpWResponse
As HttpWebResponse =
Nothing

Dim sr
As StreamReader =
Nothing

'Dim ligne As String

Try

Dim HttpWRequest As HttpWebRequest CType(WebRequest.Create(TextBox1.Text), HttpWebRequest)HttpWResponse
CType(HttpWRequest.GetResponse, HttpWebResponse)sr New StreamReader(HttpWResponse.GetResponseStream)RichTextBox1.Text sr.ReadToEnd

Catch ex
As ExceptionMessageBox.Show(ex.Message)

Finally

If
Not (HttpWResponse
Is
Nothing)
ThenHttpWResponse.Close()

End
If

If
Not (sr
Is
Nothing)
Thensr.Close()

End
If

End
Try

1 réponse

cs_Nurgle Messages postés 1642 Date d'inscription samedi 6 novembre 2004 Statut Membre Dernière intervention 28 avril 2011 4
8 oct. 2006 à 10:39
Salut,

Eh bien, cherches avec une RegExp tout ce qui ressemble en gros à ça : [ ...] .
et prend ce qu'il y a dans le champ href.

Bonne journée

<hr width="100%" size="2" />Nurgle(Antoine)
0
Rejoignez-nous